Commit graph

15 commits

Author SHA1 Message Date
zijunzhao
0a515826af Nullability check for link module
Bugs: b/245972273
Test: adb shell
Change-Id: I850deb5422604731d1d1b4ab3ea86aedad52a883
2023-03-17 02:52:15 +00:00
Ryan Prichard
a2e83ab348 Add additional dl_phdr_info fields
Previously, Bionic's dl_phdr_info only included the first four
dl_iterate_phdr fields. Several other libc's have these additional fields:

    unsigned long long dlpi_adds -- incremented when a library is loaded
    unsigned long long dlpi_subs -- incremented when a library is unloaded
    size_t dlpi_tls_modid -- TLS module ID
    void* dlpi_tls_data -- pointer to current thread's TLS block or NULL

These extra fields are also exposed by glibc, musl, and FreeBSD. The
unwinder in libgcc.a, linked into shipping Android DSOs, has a
PC->eh_frame cache that activates if dl_phdr_info has the dlpi_adds and
dlpi_subs fields (indicated at run-time by a sufficiently-large size
argument to the callback).

Bug: https://github.com/android-ndk/ndk/issues/1062
Test: bionic unit tests
Change-Id: I6f0bab548cf8c828af2ddab9eb01c5c6d70cd81f
2019-08-22 12:43:17 -07:00
Elliott Hughes
ff26a16c1d Re-submit "Name function arguments in libc headers for Studio."
This reverts commit 9af9120091 (a revert
of 079bff4fa5), now the versioner bug is
fixed.

Bug: http://b/64613623 # header bug
Bug: http://b/64802958 # versioner bug
Change-Id: I1cb9d7832d4b3aecdc57a9285e2291443e59d02d
2017-08-18 00:00:38 +00:00
Colin Cross
9af9120091 Revert "Name function arguments in libc headers for Studio."
This reverts commit 079bff4fa5.

Broke builds with SANITIZE_HOST=address with an asan failure in versioner.

Change-Id: I22b113fd5405589d1a25e5e137c450aaba1ade5f
2017-08-17 18:29:54 +00:00
Elliott Hughes
079bff4fa5 Name function arguments in libc headers for Studio.
Second batch of headers...

Bug: http://b/64613623
Test: builds
Change-Id: I8eef043dbf32afee8ff814e9d005f46aee8fa21f
2017-08-16 16:30:54 -07:00
Elliott Hughes
f2c6ad6338 Make the _Unwind_Ptr declaration match clang's.
Bug: https://issuetracker.google.com/37126620
Test: builds, boots angler
Change-Id: I7d4a9b998f2e5c4c7b0beed87807d7b76a564c5c
2017-04-21 19:52:21 +00:00
Josh Gao
16016df79f versioner: refactor to use CompilerInstance directly.
This will make it easier to switch over to a virtual filesystem,
which should drastically improve performance.

This also fixes an issue with warning/error reporting.

Bug: http://b/32748936
Test: python run_tests.py
Change-Id: I2e967acf75db29c95f3a03f4f94cccd22c367ad5
2016-11-09 13:50:07 -08:00
Josh Gao
b36efa4343 Fix instances of '#if __LP64__'.
Triggers -Wundef, which is on in -Weverything.

Bug: http://b/31496165
Change-Id: Ib06107073f7dd1d584c19c222d0430da9d35630b
2016-09-15 14:21:28 -07:00
Elliott Hughes
203e13d97d Always include <sys/cdefs.h>.
I made a mistake caught by code review earlier, so let's try to be
safer by default.

This patch also moves all our "forwarding" headers to the guardless
just-include-the-other-thing style that we usually use. (Where we
have a comment explaining where the header comes from, I've kept
that.)

Change-Id: I37342cf5e2563c6a269b2ba61a697069b1c7913b
2016-07-22 17:01:54 -07:00
Josh Gao
d51bc71294 Add platform specific version tags.
Some functions were added at different times on different platforms.
This should hopefully get most of them.

Bug: http://b/28178111
Change-Id: I85fdf92779a2f3277e9b537c6bfc7216790c607a
2016-04-29 16:39:50 -07:00
Josh Gao
14adff1cfa Add versioning information to symbols.
Bug: http://b/28178111
Change-Id: I46bf95accd819f4521afb1173d8badcc5e9df31c
2016-04-29 16:39:50 -07:00
Elliott Hughes
3a9c5d66dc Fix <link.h>.
Also move some of the stuff that should be in <link.h> out of the
private "linker.h", to make it clearer that these are public API
known to gdb that we can't change.

Bug: 12554197
Change-Id: I830e1260d3d8b833ed99bc1518f1c6b6102be8af
2014-02-10 13:31:13 -08:00
Elliott Hughes
c620059479 Remove 32-bit assumptions from the ELF code.
Change-Id: I2c1f3d34c33685799aade8866eec44479ff9f963
2013-09-30 18:43:46 -07:00
Christopher Ferris
24053a461e Add the dl_iterate_phdr function to libdl for arm.
Bug: 8410085

Merge from internal master.

(cherry-picked from cb491bc66d)

Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f
2013-09-06 09:53:54 -07:00
Pavel Chupin
b7beb69075 Add link.h for all platforms with dl_phdr_info
This header is used on bionic build and should be propagated into
sysroot on toolchain rebuild. Discussion re. this header is here:
http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00936.html

It is available already in mips NDK platforms:
development/ndk/platforms/android-9/arch-mips/include/link.h

Change-Id: I39ff467cdac9f448e31c11ee3e14a6200e82ab57
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2012-08-17 12:44:23 -07:00