Commit graph

10 commits

Author SHA1 Message Date
Ryan Prichard
238609328f Remove debug.ld.greylist_disabled property
This property provided a way to disable the greylist, for testing
whether an app targeting < 24 still works. Instead of turning off the
greylist, though, an app developer should simply target a newer API.

(If app developers really need this property for testing, they can
still use it on versions of Android between N and R, inclusive.)

Update language to comply with Android's inclusive language guidance

See https://source.android.com/setup/contribute/respectful-code for reference

#inclusivefixit

Bug: http://b/162536543
Test: bionic-unit-tests
Change-Id: Id1eb2807fbb7436dc9ed7fe47e15b7d165a26789
2020-07-30 19:29:17 -07:00
Martin Stjernholm
95252eedf3 Add more linker debug.
- Show which executable is being linked, which linker config file is
  being read, and which section in it is being used with, enabled on
  $LD_DEBUG>=1.

- Show more info to follow the dlopen() process, enabled with "dlopen"
  in the debug.ld.xxx property.

Test: Flash, boot, and look at logcat after "adb shell setprop debug.ld.all dlopen"
Bug: 120430775
Change-Id: I5441c8ced26ec0e2f04620c3d2a1ae860b792154
2019-03-19 14:03:18 +00:00
Tim Murray
a022034da2 linker: only generate log messages when logging is enabled
Avoids some unnecessary work during dlopen/dlclose/dlsym for most
cases.

Bug: 122471935
Test: fewer page faults during app startup
Change-Id: Ie886e1e671066af3c6f3a895f9a8126f209d6660
2019-01-17 14:24:14 -08:00
Elliott Hughes
5e62b34c0d Clean up bionic_macros.h a bit.
Use <android-base/macros.h> instead where possible, and move the bionic
macros out of the way of the libbase ones. Yes, there are folks who manage
to end up with both included at once (thanks OpenGL!), and cleaning that
up doesn't seem nearly as practical as just making this change.

Bug: N/A
Test: builds
Change-Id: I23fc544f39d5addf81dc61471771a5438778895b
2018-10-25 11:00:00 -07:00
Elliott Hughes
cbc80ba9d8 Switch the rest of our internal headers to #pragma once.
We've been using #pragma once for new internal files, but let's be more bold.

Bug: N/A
Test: builds
Change-Id: I7e2ee2730043bd884f9571cdbd8b524043030c07
2018-02-13 14:27:17 -08:00
Elliott Hughes
7933bec287 Add support for disabling the greylist.
Useful for testing whether apps have actually stopped using greylisted
libraries even if they still have references to them in their apk to support
old Android releases but also haven't bumped their targetSdkVersion yet.

Since we already have two expensive __system_property_get calls and this
would add a third, optimize two (but leave the third since it's not
obviously amenable to optimization). None of this matters for user builds,
but I don't want userdebug/eng to have distractingly different performance.

Bug: http://b/36106661
Test: ran "can you escape 5" with and without this property
Change-Id: Id9a804695c1dca9b4be2ebd0e72f01817bb13cba
2017-04-05 15:35:04 -07:00
Dimitry Ivanov
5c4a58072f Add systrace output for dlopen calls
Bug: http://b/27195126
Test: manual: adb shell atrace -t 5 bionic
      and run bionic-unit-tests --gtest_filter=dl*:Dl*

Change-Id: Ib2bad794e571b89bd1f52c9e0de642c2092e5c21
2017-03-20 13:34:52 -07:00
Dimitry Ivanov
4742abdcb5 Add a way to track all dlsym calls
Add dlsym option to debug.ld.all and debug.ld.app.<appname> which
enables logging of dlsym calls.

Bug: http://b/29458203
Test: flash, set debug.ld.all to dlsym and check
      if there are messages in logcat

Change-Id: I9cb815a38b5b98aac9ebe3ac1540bcdedd2e8db0
2016-12-12 16:36:12 -08:00
Dimitry Ivanov
5543746934 Pass argc/argv/envp to dso constructors
The glibc implementation of the loader passes argc/argv/envp
to all elf constructors. This change makes bionic linker
behave in the same way.

Bug: http://b/30145768
Change-Id: I1c65c42aa5305a5b133c64b5748205bbde869e0e
Test: run bionic-unit-tests --gtest_filter=dl*:Dl*
2016-07-20 16:10:19 -07:00
Dimitry Ivanov
b996d60493 linker: Enable debug logging via properties
This patch lets developers tune logging of dlopen/dlerror with
setting system property.

Note that for security purposes this option is disabled on user build
for non-debuggable apps.

For starters there are 3 debug options:
 dlerror - enables logging of all dlerrors
 dlopen - traces dlopen calls

To enable system-wide logging (works only for userdebug/eng builds)
use debug.ld.all property.

To enable logging for particular app use debug.ld.app.<appname> property.

Example: Running "adb shell setprop debug.ld.all dlerror,dlopen" will log all
dlerror message as well as trace all calls to dlopen.

Bug: http://b/29458203
Change-Id: I2392c80a795509e16fe5689d0500d18b99772a64
2016-07-12 14:22:13 -07:00