On most architectures the kernel subtracts a random offset to the stack
pointer in create_elf_tables by calling arch_align_stack before writing
the auxval table and so on. On all but x86 this doesn't cause a problem
because the random offset is less than a page, but on x86 it's up to two
pages. This means that our old technique of rounding the stack pointer
doesn't work. (Our old implementation of that technique was wrong too.)
It's also incorrect to assume that the main thread's stack base and size
are constant. Likewise to assume that the main thread has a guard page.
The main thread is not like other threads.
This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK)
whenever we're asked.
Bug: 17111575
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Change-Id: I1d4dbffe7bc7bda1d353c3a295dbf68d29f63158
Without these specs, clang will reports mismatch between standard definitions and these declarations/definitions. These specs are ignored when compiled with -fno-exceptions.
BUG: 17136236
Change-Id: I386c712a61dc4fc74dfde45f9ec2d3d037f2e9f1
We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing. This generalizes the bionic header so that it
can be used directly as the prebuilt header as well. So long as they
don't diverge again, that should somewhat improve test coverage.
Use the correct builtin for atomic_is_lock_free.
Fix atomic_flag_init.
Turn on atomic tests even with __GLIBC__, since they now appear to pass.
Include uchar.h in stdatomic.h where needed.
Add a basic memory ordering test.
Fix bit-rotted comments in bionic tests makefile.
Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
This includes:
1. Placing has_ifunc after fields with version = 0
2. Switch to has_min_version(v) function.
3. Minor soinfo initialization refactoring (placement new + ctor)
Change-Id: I1bf5fde4d930914012ce5f3ad5acb48217da9b2d
This test only works if you're root (strictly: if you have permission to
CLONE_NEWNS), so it's useful to us when we're doing ad hoc testing (since
that's usually done as root), but it's not useful as part of CTS or when
running the tests on the host.
(cherry-pick of 84d0683a824fa02dbaa6d1b56a79223804b54e80.)
Bug: 16705621
Bug: 17170200
Change-Id: Ia92c871b15f7e45fc174bb59bc95540fd00ae745
Also remove declaration.
The only user is compiler-rt, and they can replace that call with one to
syscall(2). compiler-rt doesn't currently build on mips64 anyway.
Bug: 11156955
Change-Id: Ieae0ba49c8e7aa50253401fc1d7c2d17bc867d39
No one's reported this, but I saw it in an Android port of fuser(1).
We still have lots of problems in our network headers because we
get most of the structs direct from the kernel, and it doesn't use
types like this (which is why we've got away without this one for
so long). One day we should probably look at cleaning that up, but
doing so can wait.
Change-Id: If15edf0cfc32716fa312d7ed97c48321b760d979
This way it's a lot harder for us to screw up (since we should always
be including <sys/cdefs.h> anyway).
Bug: 14659579
Change-Id: I23070fff3296b0d1c683bb5e3a6e214146327d53
Needed for __BEGIN_DECLS/__END_DECLS. Currently fine because it's being
included after other files that do this.
Change-Id: I1f12368fc461f6ef5ca90992cf19f317f0b5d7af