Clarify what part of the NDK sets the soname.

It's the build systems, not the toolchain itself.

Bug: https://github.com/android/ndk/issues/1865
Test: treehugger
Change-Id: I74b35498e32c798683fd39e7369f87ff6cc2de38
This commit is contained in:
Elliott Hughes 2023-04-13 14:45:00 +00:00
parent 66542d6b97
commit 8aa1deb96c
1 changed files with 8 additions and 8 deletions

View File

@ -107,7 +107,7 @@ feature >= Android M but still works on older releases.)
## Correct soname/path handling (Available in API level >= 23) ## Correct soname/path handling (Available in API level >= 23)
The dynamic linker now understands the difference The dynamic linker now understands the difference
between a librarys soname and its path (public bug between a librarys soname and its path (public bug
https://code.google.com/p/android/issues/detail?id=6670). API level 23 https://code.google.com/p/android/issues/detail?id=6670). API level 23
is the first release where search by soname is implemented. Earlier is the first release where search by soname is implemented. Earlier
releases would assume that the basename of the library was the soname, releases would assume that the basename of the library was the soname,
@ -326,12 +326,12 @@ libraries as the location may change from device to device.
## Missing SONAME (Enforced for API level >= 23) ## Missing SONAME (Enforced for API level >= 23)
Each ELF shared object (“native library”) must have a SONAME (Shared Each ELF shared object (“native library”) must have a SONAME
Object Name) attribute. The NDK toolchain adds this attribute by default, (Shared Object Name) attribute. The NDK build systems add this
so its absence indicates either a misconfigured alternative toolchain attribute by default, so its absence (or an incorrect soname) indicates
or a misconfiguration in your build system. A missing SONAME may lead a misconfiguration in your build system. A missing SONAME may lead to
to runtime issues such as the wrong library being loaded: the filename runtime issues such as the wrong library being loaded: the filename is
is used instead when this attribute is missing. used instead when this attribute is missing.
``` ```
$ readelf --dynamic libWithSoName.so | grep SONAME $ readelf --dynamic libWithSoName.so | grep SONAME
@ -346,7 +346,7 @@ the library you were expecting.
*Resolution*: the current NDK generates the correct SONAME by *Resolution*: the current NDK generates the correct SONAME by
default. Ensure you're using the current NDK and that you haven't default. Ensure you're using the current NDK and that you haven't
configured your build system to generate incorrect SONAME entries (using configured your build system to generate incorrect SONAME entries (using
the -soname linker option). the `-soname` linker option).
## `__register_atfork` (Available in API level >= 23) ## `__register_atfork` (Available in API level >= 23)