Also group all the RELR/arm64/riscv64 bits together rather than mixing them up slightly as we'd done so far.
Change-Id: Iff1ea2cfca9ff702b88aa2e7d09db46e2f34f965
Fail to compile bionic/tests/complex_test.cpp when updating compiler due
to the conflict.
Bug: b/346349678
Test: change the clang version and then run mm to build
Change-Id: Ic22b7325b6e52006e620e13944f3f1d76030d782
Add basic assembly stubs for TLS Descriptor support in the dynamic
linker, and enable several code paths related to TLSDESC for RISC-V.
Note: This patch requires an updated toolchain that supports TLSDESC
for RISC-V, and the `-mtls-dialect=` compiler option specifically.
Test: adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests --gtest_filter=*tls*
Bug: 322984914
Change-Id: I74bd0fa216b44b4ca2c5a5a6aec37b3fc47b00d9
Every time I look at mmap.cpp, I fail to realize it's only built for ILP32.
Also improve some of the commentary in SYSCALLS.TXT and legacy_32_bit_support.cpp.
Change-Id: Ieedfe800b437e30c060c3e8663b6d96d517dbf6f
clang-19 and later default to C++14 sized deallocation. Currently we don't have C23's C equivalent of free_sized(), so we just implement these in terms of free() for now.
Bug: http://b/344993254
Change-Id: I708710aee3f7a684bfe494a96f7baed014acbe57
I was actually here to add some new documentation, but realized there wasn't really a good place to put it...
Change-Id: I8a2fc93e61a89e87aa53dd0beb9dfcc6561687ca
Not a security problem, but definitely a bug if you're calling this and ignoring the result, since it has no side-effects.
(All of the more important functions -- realloc() especially -- are already annotated.)
Change-Id: I217463518b4716befcc0ed9426648eafbfbbdde4
Kernel headers coming from:
Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-6.9
Test: Builds and bionic unit tests pass on raven.
Test: Able to log in to an Android GO 32 bit device.
Change-Id: If53a38bbb65c3c653ce790fe5c6e51597901a14e
This is just POSIX nonsense. Android, iOS/macOS, the BSDs, and glibc all have getpagesize(). Window doesn't, but Windows doesn't have sysconf(3) either, so there's not a strong "portability" argument to be had there!
Change-Id: Ieacfbb61c3612045f27c20c3fa4fa12694db2243
The setjmp implementation is correct, but this comment was wrong, and we were missing the implementation of the test. This would be slightly simpler if we enabled Zfa in the build system and qemu, but this works for now.
Change-Id: Iad32771019584beacd8b35138ac2bf4c0a14c903
This is fairly conservative, touching only those functions (such as feof()) where it's clearly an error to not use the return value.
Also fix a test that was ignoring the return value of feof() (because it was just checking whether the function could take the lock, and genuinely didn't care about the result).
Change-Id: If2ade10ae87df45a8b9bfcb24828e460201fa9a1
A lot of people who see these via pitot or whatever don't even think to look at the real tombstone. Make it explicit that this is what they should do next. Also, since we have the numbers, say exactly what we mean by "most common".
Bug: http://b/338882189
Change-Id: Ia21848a40e82cb2486538a7578501e2ec0948e1c
I only came to improve the signature mismatch error, but I was then annoyed by the copy & paste of the other checks.
get_chunk_size() seems to be deliberately avoiding any checks, though I think that might be a bug, and there should be a get_chunk_size() that _does_ check for most callers, and a get_chunk_size_unchecked() for the <sys/thread_properties.h> stuff that seems to want to only be "best effort" (but does still have _some_ possibility of aborting, in addition to the possibility of segfaulting).
Also a bit of "include what you use" after cider complained about all the unused includes in bionic_allocator.h.
Bug: https://issuetracker.google.com/341850283
Change-Id: I278b495601353733af516a2d60ed10feb9cef36b
We only use this in one other place anyway.
Also be explicit about how `__tls_get_addr` and `___tls_get_addr` differ, since I missed that at first!
Change-Id: Ica214886c5346f118f063bca26e6dd8d74ee21f4
Strictly, this is more of "swap one form of duplication for another", but
I found the existing code non-obvious in part because people have added new
code under existing comments (which don't apply), in two places. At this
point, duplicating the _condition_ (which is much less likely to change at
all, let alone grow more complex) clarifies the code and makes the comments
match the code they're adjacent to again.
Test: treehugger
Change-Id: Ic8f01dc5b4fd14e942bf8dd7c72cab7df06d99d5
The maximum page size Android supports
now is 16384, and Art only supports 16kB,
so we can save a bit of space.
Bug: 332556665
Test: N/A
Change-Id: I23df607bcc5cf9e96d7b6a66169413cd1a883f7e
Rather than only updating the maps when a pc can't be found, always update
the maps before using them. This avoids issues where the maps change
and it could cause a crash reading from a map that has been modified.
This assumes that executed code never gets unloaded, or that the
code is unloaded so infrequently that it doesn't matter. This happens
because the pcs for the backtraces are gathered as the program runs
and those pcs are symbolized and made into relative pcs at a later time.
Also, add safe reading of the elf data when necessary to avoid any
crashes if maps are changing while this is running.
Since the MapEntry objects can be deleted, copy the values for
the current map in the backtrace code to detect when in our own code
instead of keeping a pointer.
Bug: 340988785
Test: malloc_debug unit/system tests pass.
Test: libmemunreachable tests pass.
Change-Id: Ica2ba50a5bcf9e19c7e4033e29a5a67a1847d1a6