there's no use case for prepending/appending to bool, and string
properties within module struct. Declearing "*bool" and "*string" almost
cover everything user need.
Test: m -j checkbuild
Bug: b/68853585
Change-Id: I8342d4a43fb81f2842532ddb38fba414767ac82a
ARM stopped supporting enabling of FP exceptions years ago.
Bug: http://b/68832485
Test: ran tests
Change-Id: I8450baa78e04d994c352180975b0a1ecd5a9f662
Using fclose to get the same address for the test assertion because
Samsung already uses LD_PRELOAD to intercept `close`.
Bug: http://b/67978141
Bug: http://b/68855476
Test: ran tests
Change-Id: I2da463e8b27e0db5cb1ba370d30f0402d7531396
Signed-off-by: Raj Mamadgi <r.mamadgi@samsung.com>
Fix the 'j' (intmax_t/uintmax_t) length qualifier in the wide
variant. (With new tests that fail without this fix.)
Fix a typo in the wide support for intmax_t*, which isn't testable because
%n is disabled on Android (and will be removed in a later cleanup pass).
Also move the public vfprintf/vfwprint functions into stdio.cpp.
Bug: http://b/67371539
Test: ran tests
Change-Id: Ib003599b1e9cb789044a068940b59e447f2cb7cb
It seems that feenableexcept/fegetexcept are lying to us on arm/arm64
because the hardware doesn't actually support such functionality. When
I get confirmation of that from ARM I'll fix the <fenv.h> implementation
correspondingly --- writing to/reading from reserved FP control register
bits as we currently do doesn't seem like the best of ideas.
Bug: http://b/31742322
Test: ran tests on arm/arm64/x86/x86-64
Change-Id: If78f83ddab221b568fa168c3364a7ae95c024983
Guarantee that threads live long enough for us to fiddle with them.
Bug: http://b/68768209
Test: ran tests
Change-Id: I06b1bb64fec9f8181b5f5b43ca1030e255fdccc1
These are obsolete aliases for equally obsolete functions, but apps built
with old versions of the NDK might still be emitting references to them.
Bug: N/A
Test: ran tests
Change-Id: I6eab910e3cd4d322604167799e83b5b7411c04c3
This patch switches to C++ (in anticipation of needing it later), removes
a little duplication (via a macro for now), and ensures uniform support
for %C/%lc and %S/%ls between regular and wide (with new tests).
Since it's so hard to debug problems in printf (as the time I've wasted
already today will testify), that's all I want to do in this change. The
other 500 lines of diff can wait...
(Also merge "floatio.h" into "local.h" now all the users are in forked
code.)
Bug: http://b/67371539
Test: ran tests
Change-Id: I083353d89c32b9302d759ca6967cc6d8a62cd8a5
Also simplify trivial one-liners like perror/puts/fputs, and clean up
fread/fwrite slightly.
Fix perror to match POSIX.
Add basic perror and *_unlocked tests.
Bug: N/A
Test: ran tests
Change-Id: I63f83c8e0c15c3c4096509d17421ac331b6fc23d
Following up on comments from I40c66ff9e638b306878ada006bc2c98f2346e77a.
My best attempt at a name that conveys "a test that fails to compile in
N different ways with FORTIFY enabled, and is intended to be used with
either FileCheck, or as a cheap way to check that FORTIFY is getting
properly disabled given some set of flags."
Bug: None
Test: mma.
Change-Id: I6d62875bd1cabc5d01b10ae0f03accd5ee5c8c0a
Having FORTIFY enabled for clang-tidy adds no value, and breaks some
heuristics for recognizing standard library functions (see the bug).
This also disables FORTIFY for the static analyzer (which we use
through clang-tidy), because it presumably tries to recognize standard
library functions through similar heuristics.
Bug: 36664104
Test: mma with and without the patch to cdefs. New test breaks without.
Change-Id: I40c66ff9e638b306878ada006bc2c98f2346e77a
LP32 continues to ignore failures to set scheduler attributes for
backwards compatibility with pre-Honeycomb bugs :-(
Bug: http://b/68486614
Test: ran tests (32-bit and 64-bit!)
Change-Id: I18a012cdf2f3c5bb63a5367bca2bac2de7f53ae2
Historically, Android defaulted to EXPLICIT but with a special case
because SCHED_NORMAL/priority 0 was awkward. Because the code couldn't
actually tell whether SCHED_NORMAL/priority 0 was a genuine attempt to
explicitly set those attributes (because the parent thread is SCHED_FIFO,
say) or just because the pthread_attr_t was left at its defaults.
Now we support INHERIT, we could call sched_getscheduler to see whether
we actually need to call sched_setscheduler, but since the major cost
is the fixed syscall overhead, we may as well just conservatively
call sched_setscheduler and let the kernel decide whether it's a
no-op. (Especially because we'd then have to add both sched_getscheduler
and sched_setscheduler to any seccomp filter.)
Platform code (or app code that only needs to support >= P) can actually
add a call to pthread_attr_setinheritsched to say that they just want
to inherit (if they know that none of their threads actually mess with
scheduler attributes at all), which will save them a sched_setscheduler
call except in the doubly-special case of SCHED_RESET_ON_FORK (which we
do handle).
An alternative would be "make pthread_attr_setschedparams and
pthread_attr_setschedprio set EXPLICIT and change the platform default
to INHERIT", but even though I can only think of weird pathological
examples where anyone would notice that change, that behavior -- of
pthread_attr_setschedparams/pthread_attr_setschedprio overriding an
earlier call to pthread_attr_setinheritsched -- isn't allowed by POSIX
(whereas defaulting to EXPLICIT is).
If we have a lot of trouble with this change in the app compatibility
testing phase, though, we'll want to reconsider this decision!
-*-
This change also removes a comment about setting the scheduler attributes
in main_thread because we'd have to actually keep them up to date,
and it's not clear that doing so would be worth the trouble.
Also make async_safe_format_log preserve errno so we don't have to be
so careful around it.
Bug: http://b/67471710
Test: ran tests
Change-Id: Idd026c4ce78a536656adcb57aa2e7b2c616eeddf
And add more tests.
Bug: N/A (but I'm here because a recent test broke existing tests)
Test: ran tests
Change-Id: Ib78430f179b43484a49bb50ff447ea6870c1ee3a
The only explanation for this and the unistd_test failures is that I
wasn't actually running the code I thought I was. There are some unrelated
netdb_test failures still to come...
Bug: N/A
Test: ran tests
Change-Id: I91af9d2d6a42f5433fa27e7cd8f5b903e1af36ba
A previous change added new assertions about these, but didn't remove
these old now-invalid assertions.
Bug: http://b/68133223
Test: ran tests
Change-Id: Ib6ce6e5f7abe143f2c871e074e7fd51faaf452ac
Added a test to make sure linker produces correct error message
when user attempts to load a library in a linked namespace and fails.
Bug: http://b/67866190
Bug: http://b/64950640
Bug: http://b/64888291
Test: bionic-unit-test --gtest_filter=dlext*
Change-Id: I5b5c2070d1388eff123118350b2b5c8fc7571a29
These are still needed for backwards compatibility with code built by old
versions of the NDK, but we don't need to pollute the headers with them.
Also lose the hand-written code for these. The compiler-generated code
is either the same or better, and no new code is calling these functions
anyway.
Bug: N/A
Test: ran tests
Change-Id: Ib01ad9805034433e0105aec882608cc8e6526f78
I'm skeptical about the usefulness of this, but it's in POSIX, it's
in glibc (but not iOS), and it is used in some internal source (test
runners and container code).
Bug: N/A
Test: ran tests
Change-Id: I92c5398f2a679b21a33fba92bc8e67e3ae2eb76f
Surprisingly to me, there are actual uses of `swab` in the codebases
I have available to search, including one with a #ifndef __ANDROID__
around it.
Bug: N/A
Test: ran tests
Change-Id: Ic91b78ae22bb65c346cb46dd38916f48d979abe0
Went through the POSIX spec for the _POSIX* and _XOPEN* constants.
Bug: http://b/32776472
Test: ran tests
Change-Id: I389100dbc7de354eae9056e44b0a7fa8c37374e3
Add all the missing <netdb.h> functions.
Also fix getservbyport to handle a null protocol correctly.
Also fix getservbyname/getservbyport to not interfere with getservent.
Also fix endservent to reset getservent iteration.
Also reduce unnecessary differences from upstream NetBSD sethostent.c.
The servent implementation is still horrific, and we should
probably support protoent too so that debugging tools can use
getprotobyname/getprotobynumber.
Bug: N/A
Test: ran tests
Change-Id: I639108c46df0a768af297cf3bbce857cb1bef9d9
The executable flag might not be present for the executable segment
if the code is being handled by native bridge implementation. This
commit changes the test to restore executable flag for first segment
if it was removed.
Test: bionic-unit-tests
Change-Id: Ie930539135edc4db3245574b5cbe476aa1ad49c7
arm32 is still missing vdso (at least on some kernels).
This commit adds explicit check for it and skip the test
if AT_SYSINFO_EHDR is not set.
Test: run 32bit bionic-unit-tests --gtest_filter=dlfcn.dlopen_vdso on angler
Change-Id: I7fae78c6a4f819601a4ac9e8e1da53ff07c833ff
We need to be able to store build fingerprints that are over 92 characters
long, which is the current restriction for system property value
length.
Increasing the value maximum across the board has plenty of caveats,
particularly that an allocator would be required to handle
deallocation when replacing long property values with short values.
There is also no compelling reasons to do this.
But, increasing the length of simply read-only properties, such as the
build fingerprint, has less caveats as there will never be a
deallocation of these strings.
This change uses spare bits in the top of serial (only spare for
read-only properties) to indicate if a property is 'long' or not. The
information required to access these 'long' properties is stored in a
union where the legacy property value is located. An error message is
retained for legacy callers.
The new property is readable via __system_property_read_callback() and
most importantly android::base::GetProperty and higher level (Java,
`getprop`) callers. All code should move to these higher level
functions as much as possible.
Bug: 23102347
Bug: 34954705
Test: bionic unit tests
Change-Id: Ia85e0d979b92afff601cc52b39114379617a0c64
The newest of these clocks was added in Linux 2.6.12, so no need for runtime
checks.
Add CTS tests that we can actually use the various clocks.
Bug: http://b/67458266
Test: ran tests
Change-Id: I3cfd7982043d6f8d4ebdc2b29e8722334f443ce5
Adds a necessary library, and disables the glibc host tests when
building for bionic host.
Bug: 31559095
Test: mmma bionic
Change-Id: Ie825db59a21bf8e9b4dbdadc63ff14bf8da23087
Not sure how this managed to cling on in AOSP master, but all the other
mentions of this constant in AOSP master are already expecting the new
value anyway.
Bug: N/A
Test: ran tests
Change-Id: I8b6b4b320eeb1c4cea1c06bea4c1e8e314ee344d
The tests that use LD_CONFIG_FILE environment variable shouldn't be run
on non-production devices because LD_CONFIG_FILE is only for debuggable
builds. We have used the build-time flag USE_LD_CONFIG_FILE, which is
set for the debuggable builds, to conditionally include or exclude the
tests. However, this can be a problem when 1) the device is not
debuggable but 2) the CTS itself is built with debuggable target. So,
instead of relying on the build-time flag USE_LD_CONFIG_FILE, the tests
now check the debuggability of the device and skip the tests when it
isn't debuggable.
Bug: 65842135
Test: 1) flash user build image to a 2017 pixel device.
2) build cts with 'userdebug' build target
3) CtsBionicTestCases pass on the device
(cherrypick of 5e3d44100be32fd5efffd0c309bd90c04cc9620c.)
Change-Id: Ib88e3b26d093e5479d52cd87db47dee5e108cac2
Stop allocating and deallocating memory as part of the test itself.
There's still the fopen, but since our stdio reuses existing structs,
that doesn't seem to be a problem in practice.
Bug: http://b/67077411
Test: ran tests with --gtest_repeat=1000
Change-Id: I99de5de0911161ec04afe75653075f1ccefb01a5
Just to avoid the possibility of an unfortunate mmap occurring in order to
grow the vector.
Bug: N/A
Test: ran tests
Change-Id: I850740461d761916a0377272664159d010da7b84
It's almost 2018, Linux 3.17 -- the first kernel with getrandom(2) --
was released in October 2014, and being able to assume getrandom lets
us simplify and improve some security-related code in libc, and revert a
hack to getentropy that's been necessary in the meantime. Only the fugu
kernel doesn't have getrandom(2) at this point, and that's EOL.
Bug: http://b/67014255
Test: ran tests
Change-Id: I1736f4dd33d50fe99e7a524851180989f4c85a33
iOS 10 has <sys/random.h> with getentropy, glibc >= 2.25 has
<sys/random.h> with getentropy and getrandom. (glibc also pollutes
<unistd.h>, but that seems like a bad idea.)
Also, all supported devices now have kernels with the getrandom system
call.
We've had these available internally for a while, but it seems like the
time is ripe to expose them.
Bug: http://b/67014255
Test: ran tests
Change-Id: I76dde1e3a2d0bc82777eea437ac193f96964f138
libdl is part of system_shared_libs now. -ldl -lpthread -lm are now defaults
for host_ldlibs on Linux and Darwin. -lrt is a default for host_ldlibs on
Linux.
Test: m host
Test: mmma bionic
Change-Id: I966e2f88c24fba5e412bee6b6382045a2026a8e4
This is the FreeBSD implementation, plus some tests. The FreeBSD
implementation includes the GNU extensions and seems to be what
iOS is using too, which should provide bug compatibility for app
developers.
The code unfortunately uses a lot of stack, and uses FreeBSD locale
implementation that we don't have, but it does seem better maintained
than the other BSDs.
Bug: http://b/29251134
Test: ran tests
Change-Id: Ie477b45e42a6df1319b25712098519d2b33adf67
Also set linked flag after it is linked and
call constructors. Set RTLD_NODELETE flag to
prevent accidental unloads.
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Test: bionic-unit-tests-glibc --gtest_filter=dl*
Change-Id: Ib2178849b918cbefd6f8fcfe6d1f78889fe0bf76
Previously the test compared /proc/version read into expected[256]
with actual[BUFSIZ]. This CL aligns the both of the buffer sizes to
the same BUFSIZ, so that /proc/version longer than 256 bytes won't
result in a test failure.
Bug: 66872345
Test: fcntl#tee on a device with long /proc/version (Chromebook Plus)
Change-Id: I004dd2189565b0bdde1aa22a2f25fafe74560180
(cherry picked from commit 85a08ae9fead3f24daf108108257e4793a192e5f)
The tests that use LD_CONFIG_FILE environment variable shouldn't be run
on non-production devices because LD_CONFIG_FILE is only for debuggable
builds. We have used the build-time flag USE_LD_CONFIG_FILE, which is
set for the debuggable builds, to conditionally include or exclude the
tests. However, this can be a problem when 1) the device is not
debuggable but 2) the CTS itself is built with debuggable target. So,
instead of relying on the build-time flag USE_LD_CONFIG_FILE, the tests
now check the debuggability of the device and skip the tests when it
isn't debuggable.
Bug: 65842135
Test: 1) flash user build image to a 2017 pixel device.
2) build cts with 'userdebug' build target
3) CtsBionicTestCases pass on the device
Change-Id: Ib88e3b26d093e5479d52cd87db47dee5e108cac2
Return EAGAIN rather than aborting if we fail to set up the TLS for a new
thread.
Add a test that uses all the VMAs so we can properly test these edge cases.
Add an explicit test for pthread_attr_setdetachstate, which we use in the
previous test, but other than that has no tests.
Remove support for ro.logd.timestamp/persist.logd.timestamp, which doesn't
seem to be used, and which prevents us from logging failures in cases where
mmap fails (because we need to mmap in the system property implementation).
Bug: http://b/65608572
Test: ran tests
Change-Id: I9009f06546e1c2cc55eff996d08b55eff3482343
This also fixes a long-standing bug where the guard region would be taken
out of the stack itself, rather than being -- as POSIX demands -- additional
space after the stack. Historically a 128KiB stack with a 256KiB guard would
have given you an immediate crash.
Bug: http://b/38413813
Test: builds, boots
Change-Id: Idd12a3899be1d92fea3d3e0fa6882ca2216bd79c
(Where errno is relevant.)
Also consistently use -1 as the fd for anonymous mmaps. (It doesn't matter,
but it's more common, and potentially more intention-revealing.)
Bug: http://b/65608572
Test: ran tests
Change-Id: Ie9a207632d8242f42086ba3ca862519014c3c102
We can cut a lot of stuff out of the NDK's libandroid_support with this,
and reduce unnecessary relocations for all LP32 code. LP64 code should
be unaffected.
Bug: https://issuetracker.google.com/64450768
Bug: https://github.com/android-ndk/ndk/issues/507
Test: ran tests, plus manual readelf on the _test.o files
Change-Id: I3de6015921195304ea9c829ef31665cd34664066
clang is the default compiler since Android nougat
Test: mma & verified it´s still build with clang
Change-Id: Id8b5361d18c1b2febb2dc6cc44502feaa08f605c
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
Because I want something to copy & paste into the NDK support library test
that's slightly better than taking the address of the function...
Bug: https://github.com/android-ndk/ndk/issues/502
Test: ran tests
Change-Id: If43089d16691d6a4dcf5d972450b14ed85bbca81
I'm unable to find a bug, but we've had requests for this internally
once or twice (though I pointed those folks at the STL), and there's
code we build for the host or in our bootloaders that would use this,
and there's reasonable-looking FreeBSD implementation ready and waiting.
Bug: N/A
Test: ran tests
Change-Id: I6ddee4b71bea4c22ed015debd31d3eaac4fcdd35
dlext.ns_shared creates a child namespace, which is isolated & shared,
from the default namespace. It then checks whether a lib that was loaded
in the parent(=default) namespace *after* the child namespace is created
is not accessible to the child namespace. Because this test is using the
default namespace as a parent namespace, the test result is dependent on
the specific configuration of the default namespace, which isn't
desirable.
Specifically, since ANDROID_NAMESPACE_TYPE_SHARED now copies search
paths and permitted paths of the parent namespace to the child namespace,
a lib that is accessible to the former is also accessible to the latter
even if the lib hasn't been shared when creating the latter. So, the
result of the test varies depending on whether the default namespace has
permitted paths or not. (if it is configured as an isolated namespace
and has permitted paths, then the test fails).
In order to make this test be independent from how the default namespace
is configured, a parent namespace is explicitly created and the child
namespaces are created from the parent namespace, not from the default
namespace.
Bug: 65189955
Test: bionic-unit-tests --gtest_filter=dlext.ns_shared successful
Test: the same test successful when the default namespace is configured
as follows
namespace.default.isolated = true
namespace.default.permitted_paths = ...:/data
Change-Id: Ifa33c6c42f8c327b2b1c380c7abba8e8f1afee82
The test always fails when run on non-production devices. Silence the
expected failure.
Bug: 64908138
Test: run CtsBionicTestCases on userdebug device. disable_ld_config_file
test does not fail.
Merged-In: Icd24a356dfbc62f540e3263070434a4fd065bfbc
Change-Id: Icd24a356dfbc62f540e3263070434a4fd065bfbc
(cherry picked from commit 157655dc67)
The test always fails when run on non-production devices. Silence the
expected failure.
Bug: 64908138
Test: run CtsBionicTestCases on userdebug device. disable_ld_config_file
test does not fail.
Change-Id: Icd24a356dfbc62f540e3263070434a4fd065bfbc
Well, all except <threads.h> which we have no current plans to implement.
The only thing this turned up is that clang's <float.h> doesn't define
FLT_HAS_SUBNORM/DBL_HAS_SUBNORM/LDBL_HAS_SUBNORM, so for now we assert
that those are missing so that when we get a fixed clang, we notice.
Also the <tgmath.h> is utterly perfunctory, but seems like an appropriate
amount of effort to put in.
Bug: N/A
Test: ran tests
Change-Id: I7f7a7040b3271ceda625bee8a40a9d8cef52ee44
GMM calls this system call directly at the moment. That's silly.
Bug: http://b/36405699
Test: ran tests
Change-Id: I1e14c0e5ce0bc2aa888d884845ac30dc20f13cd5
- Rewrite BufferOutputStream to handle 0 sized buffers and to get rid
of an unnecessary loop.
- Add tests to verify overflow corner cases.
- Implement async_safe_format_buffer to call async_safe_format_buffer_va_list
instead of duplicate the code.
Test: Ran new unit tests, booted on angler.
Change-Id: I7fb13e209f5b7443d212f55aab4b05ff2e0e8219
This commit fixes wchar.wcstold_hex_floats on arm64. On AArch64
(ARM64), the `long double` type has 128 bits and is more precise then
`double` type (64-bit). As a result, `1e100L` is slightly different
from `static_cast<long double>(1e100)`.
This commit fixes the regression by adding 'L' after the floating point
literals. This should work because casting from a higher precision
to lower precision won't lose any precisions.
Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests \
--gtest-filter=wchar.wcstold_hex_floats
Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Change-Id: Ibd7b6a5d46c38338b4ca56838d9d272c710b32f6
FORTIFY's *_chk functions mess with ASAN's library function
interceptors, which can apparently result in false-positives.
Since adding even more complexity to every run-time check condition in
FORTIFY doesn't seem like a great idea, and the majority of our builds
will still use FORTIFY anyway, turning FORTIFY off here seems
reasonable.
Bug: 63104159
Test: checkbuild on internal master + CtsBionicTestCases. No new
failures.
Change-Id: Id32e551e28ee70a9815ad140c3253b86f03de63f
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.
Test: device bionic tests
Bug: 64293803
(cherry picked from commit 97c16f8dca)
Change-Id: Ia82152f568e3a80deb902d02fa400e88e3f556bc
I've half a mind to make this a warning instead, since this sort of
call isn't UB. That said:
- if the user really wants this (I can't imagine why they would), they
can just put NULL in a non-const variable,
- we're slowly moving to -Werror ~everywhere anyway, and
- it's presumably easier to change this from an error to a warning than
the other way around
Bug: 12231437
Test: m checkbuild on bullhead internal master. No new
CtsBionicTestCases failures.
Change-Id: Ie8bf5a3455f663686fda4a7450fb35d147fa745e
Not sure how this ended up broken. Too many branches!
Bug: http://b/64565873
Test: ran tests
(cherry picked from commit 6c135f4c41)
Change-Id: Ie7078541d2a75fb2fbcf03e78a49707307b674c0
Remove the check that AIDs in the OEM range are not defind in
android_filesystem_config, as we do not yet have a good solution for
OEMs to define custom AIDs and what OEMs are currently doing isn't
hurting anything.
Bug: b/64137613
Test: pwd.getpwent_iterate / grp.getgrent_iterate
Change-Id: If98ad4443fe9e827e3f17b3df92eca82763e6290
(cherry picked from commit a14485adde)
Remove the check that AIDs in the OEM range are not defind in
android_filesystem_config, as we do not yet have a good solution for
OEMs to define custom AIDs and what OEMs are currently doing isn't
hurting anything.
Bug: b/64137613
Test: pwd.getpwent_iterate / grp.getgrent_iterate
Change-Id: If98ad4443fe9e827e3f17b3df92eca82763e6290
Strictly, the mode isn't really meaningful unless you supply O_EXCL,
but the kernel will take it and fstat will return it even if you
never give the file a name.
Also warn for O_TMPFILE without a mode at compile time where possible.
Bug: N/A
Test: ran tests
Change-Id: I729b6d6e6190676fd017a1190b6200bf9abdbfd8
With ld.config.txt, we now have multiple built-in namespaces other than
the default namespace. Libs (and their dependents) listed in LD_PRELOAD
must be visible to those additional namespaces as well.
This also adds a debugging only feature: path to the linker config file
can be customized via LD_CONFIG_FILE environment variable. This works
only for debuggable builds.
Bug: 38114603
Bug: 62815515
Test: 1. ./external/compiler-rt/lib/asan/scripts/asan_device_setup --lib
prebuilts/clang/host/linux-x86/clang-stable/lib64/clang/5.0/lib/linux
2. enable talkback shortcut
3. in the home screen, hold vol-up/down together
4. device does not reboots and talkback shortcut is toggled
Test: bionic-unit-tests and linker-unit-tests successful
Merged-In: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
Change-Id: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
(cherry picked from commit 02586a2a34)
__cfi_shadow_size returns the size of the CFI shadow mapping, or 0 if
CFI is not (yet) used in this process. This can be used to adjust
RLIMIT_AS setting.
Test: device bionic tests
Bug: 64293803
Change-Id: Icd7164f96aa7115b3585c21c0f68529cd2f07c11
With ld.config.txt, we now have multiple built-in namespaces other than
the default namespace. Libs (and their dependents) listed in LD_PRELOAD
must be visible to those additional namespaces as well.
This also adds a debugging only feature: path to the linker config file
can be customized via LD_CONFIG_FILE environment variable. This works
only for debuggable builds.
Bug: 38114603
Bug: 62815515
Test: 1. ./external/compiler-rt/lib/asan/scripts/asan_device_setup --lib
prebuilts/clang/host/linux-x86/clang-stable/lib64/clang/5.0/lib/linux
2. enable talkback shortcut
3. in the home screen, hold vol-up/down together
4. device does not reboots and talkback shortcut is toggled
Test: bionic-unit-tests and linker-unit-tests successful
Change-Id: I9a03591053f4a9caea82f0dcb23e7a3d324bb9bd
I was intending to change our behavior to match POSIX, but reality convinced
me otherwise.
Also add missing argument names to the header file on the assumption they'll
be shown in Studio one day.
Bug: http://b/26203902
Test: ran tests
Change-Id: I2aaea48a88d408a32925033fc8f17448fb63252e
This also has a handful of style fixups, to make this file more
consistent. And removes __bionic_zero_size_is_okay_t, since there's a
better workaround available.
Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.
Change-Id: I75a020630dbab0ce828563502900cba14ae992d1
Since realpath no longer needs to be overloaded, we can restore the
upstream source to purity. We'll be able to do this with most of the
other functions when we pull a newer clang in.
Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.
Change-Id: I484221bba0b291273fece23d2be2f5f9fd713d2c
This also throws in some reformatting to match the GCC FORTIFY style in
this file (e.g. 4 space standard indent).
Per b/36984245, some function protos are unwrapped beyond 100 chars, as
well.
Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.
Change-Id: I6dce60ec14d5cd703d9e724699634a197ca11023