Commit graph

27649 commits

Author SHA1 Message Date
Yi Kong
e3d90de50b Switch libm to libcrt.builtins
After switching libm from libgcc to libcrt.builtins, some of the symbols
are no longer getting included in libm, causing the compiler to complain
about missing symbols from the version script. Explicitly export them in
libc (since libm depends on libc).

Bug: 122993571
Test: m checkbuild
Test: bionic-unit-tests
Change-Id: Ie91765874d20df605f557b1a8c4236619553c549
2019-02-22 13:33:15 -08:00
Treehugger Robot
58239d0020 Merge "Revert "Revert "Turn on XOM for libc""" 2019-02-22 20:46:27 +00:00
Jeffrey Vander Stoep
dced8138d8 Revert "Revert "Turn on XOM for libc""
This reverts commit d119269c1c.

Reason for revert: b/124792601 fixed

Change-Id: I8603231042b0e70772fc174f5493db4ef0587323
Test: bionic-unit-tests
Bug: 122993569
Bug: 123241361
2019-02-21 23:13:52 +00:00
Dan Albert
5e15f34c50 Merge "Make static ifunc resolvers optional." 2019-02-21 21:14:09 +00:00
Treehugger Robot
7cdbd0d477 Merge "linker: allow using reserved space for multiple libraries." 2019-02-21 16:06:17 +00:00
Torne (Richard Coles)
efbe9a5eef linker: allow using reserved space for multiple libraries.
Introduce a new flag ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE which
instructs the linker to use the reserved address space to load all of
the newly-loaded libraries required by a dlopen() call instead of only
the main library. They will be loaded consecutively into that region if
they fit. The RELRO sections of all the loaded libraries will also be
considered for reading/writing shared RELRO data.

This will allow the WebView implementation to potentially consist of
more than one .so file while still benefiting from the RELRO sharing
optimisation, which would otherwise only apply to the "root" .so file.

Test: bionic-unit-tests (existing and newly added)
Bug: 110790153
Change-Id: I61da775c29fd5017d9a1e2b6b3757c3d20a355b3
2019-02-20 17:29:36 -05:00
Dan Albert
a535d3ca65 Make static ifunc resolvers optional.
Gold isn't emitting these symbols, so we don't necessarily have the
support for them (gold is still the default for most architectures in
the NDK).

Test: bionic static unit tests
Bug: None
Change-Id: Ifc360cb6c26571fb3f0309adb0faf0af7ee5b36f
2019-02-20 12:44:19 -08:00
Treehugger Robot
b656d4a1da Merge "Revert "Turn on XOM for libc"" 2019-02-20 17:02:39 +00:00
Treehugger Robot
c46cc7d83d Merge "Waive AID Range check for devices through Q" 2019-02-20 10:42:56 +00:00
Yi Kong
d119269c1c Revert "Turn on XOM for libc"
This reverts commit 51b8255cf5.

Breaks app compat.

Bug: 124792601
Change-Id: I99690d0092066fdfd76dc68aa3ed0fe0df873892
2019-02-20 10:27:38 +00:00
Treehugger Robot
4284fe96f6 Merge "Mark lib_async_safe_headers as supporting linux_bionic" 2019-02-20 06:17:01 +00:00
Tom Cherry
9da8ff1270 Waive AID Range check for devices through Q
We still don't have a good way to create vendor AIDs in the system or
other non-vendor partitions, therefore we keep this check disabled.

Bug: 73062966
Test: treehugger
Change-Id: I7aed425899d6ec11a22702ccec82476eacdbc790
2019-02-19 13:24:59 -08:00
Elliott Hughes
11dff3e91c Merge "Add TEST_MAPPING." 2019-02-19 18:00:37 +00:00
Alex Light
7448f3e5dd Mark lib_async_safe_headers as supporting linux_bionic
This target is needed by linux_bionic targets and so should support
it.

Test: ./art/tools/build_linux_bionic.sh com.android.runtime.host
Change-Id: Ib12f1cf1d70e606b0921f507b3e460f5d543017e
2019-02-19 09:47:40 -08:00
vichang
54c864052b Merge "Redirect /system/lib/libicuuc.so regardless of duplication in /system" 2019-02-19 10:14:31 +00:00
Elliott Hughes
f05dd837cb Add TEST_MAPPING.
Test: treehugger
Change-Id: I28eced257260028553bb0dc02a9d99bcbf266378
2019-02-16 09:06:57 -08:00
Treehugger Robot
a60488109c Merge "Fix: symbols/bionic/lib64/libc.so is the wrong variant" 2019-02-16 01:51:11 +00:00
Elliott Hughes
d102cf62d1 Merge "Switch linker tests to Android.bp." 2019-02-16 01:11:56 +00:00
Elliott Hughes
f84d0a95bd Merge "libasync_safe: stop clobbering other folks' identifiers." 2019-02-16 00:12:51 +00:00
Yi Kong
f60449c21c Merge changes Ibce7bd9d,Ieab5af35
* changes:
  Turn on XOM for libc
  Switch libc to libcrt.builtins
2019-02-15 23:58:10 +00:00
Treehugger Robot
f4533e6956 Merge "Remove unused .mk file." 2019-02-15 23:42:46 +00:00
Treehugger Robot
cf6cec8489 Merge "bionic/malloc_iterate_test: Adjust callback for procinfo::ReadMapFile" 2019-02-15 23:03:00 +00:00
Elliott Hughes
15a2b7b17b Switch linker tests to Android.bp.
Life is easier if we just keep test code in the same directory as the
stuff it's testing...

Test: tests still build and pass
Change-Id: I9b35d689098bdc28a71d69645b0ca9fdd6ea0108
2019-02-15 14:40:08 -08:00
Elliott Hughes
2ae246d0d1 Remove unused .mk file.
Test: treehugger
Change-Id: I5e560247e466dd2fe0038e787756f5a47461f240
2019-02-15 13:24:09 -08:00
Yi Kong
51b8255cf5 Turn on XOM for libc
Test: bionic-unit-tests
Bug: 122993569
Bug: 123241361
Change-Id: Ibce7bd9dc45c39a27fee33fd0566483dd8427cce
2019-02-15 12:48:26 -08:00
Yi Kong
165b1cf57b Switch libc to libcrt.builtins
With the switch to libcrt.builtins, some symbols no longer becomes
exported. Add dummy references to them to force them to be exported.
This is to maintain backwards binary compatibility with ancient Android
versions.

x86 and x86_64 crashes with libcrt, keep using libgcc for now.

Test: bionic-unit-tests
Bug: 29275768
Bug: 122993569
Change-Id: Ieab5af354e3924af4a03d888b28c6e75090cb613
2019-02-15 12:46:19 -08:00
Pirama Arumuga Nainar
a192c50e5a Merge "Clarify reason for native_coverage being off for libdl" 2019-02-15 19:52:26 +00:00
Pirama Arumuga Nainar
eeb2ee65f7 Clarify reason for native_coverage being off for libdl
Bug: http://b/124067925

It's off because it doesn't link with any system_shared_libs.

Test: N/A
Change-Id: I293fb9ba8df213f8f6bbec85135a974e5966f0cc
2019-02-15 11:40:40 -08:00
Treehugger Robot
be9b7240c2 Merge "Remove removed functions from symbol_ordering." 2019-02-15 08:11:50 +00:00
Christopher Ferris
7ae03335fc Merge "malloc debug: fix LogFreeError error log" 2019-02-15 06:52:07 +00:00
Jiyong Park
88d03200d4 Fix: symbols/bionic/lib64/libc.so is the wrong variant
The new module type bionic_mountpoint wasn't mutated by the sanitizer.
As a result, it has been taking non-sanitized symbol libraries even for
sanitized builds. Fixing the issue by making the module type to
implement the cc.Sanitizeable interface so that it can be mutated by the
sanitizer.

Bug: 124469750
Test: SANITIZE_TARGET=hwaddress m
Inspect Android-<target>.mk and check that LOCAL_SOONG_UNSTRIPPED_BINARY
for libc.mountpoint module is pointing to a hwasan variant of libc.so

Change-Id: I10c863c0dbd361463648a4b7d897a4f88a9c85cb
2019-02-15 12:15:27 +09:00
Treehugger Robot
4788931135 Merge "Disable native_coverage for ld-android and linker" 2019-02-15 02:17:45 +00:00
Christopher Ferris
6cf828c310 Merge "Avoid heapprofd init when other hooks enabled." 2019-02-15 01:43:19 +00:00
Iris Chang
b34415046c malloc debug: fix LogFreeError error log
When free_track option is enabled and malloc debug detects error in
VerifyFreedPointer flow, if freed pointer's usable_size is more than
g_debug->config().fill_on_free_bytes(), the error log is not correct.

The max. bytes printed to error message should be the max bytes to
cmp, not usable size.

Bug: 124420174
Test: build pass and test pass
Change-Id: I41f35ab3330e49e0a6ad276d405bf4f6c3f0ea92
2019-02-14 17:15:03 -08:00
Dan Albert
30a0bf0aec Remove removed functions from symbol_ordering.
Test: treehugger
Bug: None
Change-Id: Id398f8d5b3d8a6f9acc25cf222ba8c963e4a6341
2019-02-14 14:52:41 -08:00
Elliott Hughes
3019d78d4a libasync_safe: stop clobbering other folks' identifiers.
The log priorities and ids are in an NDK header, available to everyone.

Move CHECK into its own header for now. This would be better if it was
more like the <android-base/logging.h> CHECK family, but I don't have an
easy way to do that without lots of copy & paste, so punting for now.

Bug: https://issuetracker.google.com/issues/119713191
Test: boots
Change-Id: I4566be8a0a024fede0e2d257c98b908ec67af2a8
2019-02-14 14:23:13 -08:00
Pirama Arumuga Nainar
fcd35380dd Disable native_coverage for ld-android and linker
Bug: http://b/116873221

The coverage library, which depends on libc, cannot link with libraries
since they opt of libc.

Test: m NATIVE_COVERAGE=true COVERAGE_PATHS=bionic
Change-Id: Iaaca8bc30c8ba59e5d4f7092b1a0fce8e8c14c72
2019-02-14 13:50:55 -08:00
Christopher Ferris
2822856e98 Avoid heapprofd init when other hooks enabled.
All of the heapprofd code assumes that it's the only hook that
has been enabled. Enforce that by disallowing heapprofd from
enabling if malloc debug or malloc hooks have been enabled.

Test: Ran all unit tests (bionic/malloc hooks/malloc debug/perfetto).
Test: Enabled malloc debug ran perfetto integration tests and verified
Test: that an error message goes to the log.
Change-Id: I506fbf1c5b8e4052855531fa0d161f5de06e6c1a
2019-02-14 10:23:58 -08:00
Treehugger Robot
1b82812635 Merge "Fix hwasan build." 2019-02-14 08:04:46 +00:00
Christopher Ferris
883144719a Fix hwasan build.
Test: hwasan builds properly.
Change-Id: I3c911da08d1925b797423671e3beb72770a934b0
2019-02-13 22:15:28 -08:00
Treehugger Robot
1462d267e2 Merge "Symbols files under $(OUT)/symbols/bionic/" 2019-02-14 05:27:44 +00:00
Pirama Arumuga Nainar
bd912d2868 Merge "Disable native_coverage for libdl" 2019-02-14 00:05:57 +00:00
Treehugger Robot
b5c1b12389 Merge "Sync with upstream NetBSD." 2019-02-14 00:04:20 +00:00
Elliott Hughes
4fc93ffa62 Sync with upstream NetBSD.
Bug: http://b/123359356
Test: treehugger
Change-Id: Ide95d7eeb24cc0e22914162be423f8bacfdd3548
2019-02-13 14:17:18 -08:00
Treehugger Robot
0197b0a92f Merge "Use no_libcrt property instead of hard coding projects to exclude" 2019-02-13 21:53:26 +00:00
Christopher Ferris
c2136b51aa Merge "Refactor malloc common into distinct pieces." 2019-02-13 18:38:22 +00:00
Victor Chang
af12c94e79 Redirect /system/lib/libicuuc.so regardless of duplication in /system
The change is a workaround of app compat issue until the app fixes the
issue.

Likely, the app does not only dlopen(), but open() the libicuuc.so
with the absolute path.

Note that platform uses the stub libandroidicu.so, not libicuuc directly.
This CL topic moves (not duplicates) libandroidicu from /system to
/apex. Even though /system/lib/libicuuc.so is kept in the default
namespace, but no one should be using it.

Some debug info after this CL:
$ adb shell cat /proc/<zygote pid>/maps | grep libicuuc
$ adb shell cat /proc/<app pid>/maps | grep libicuuc
Only /apex/com.android.runtime/lib64/libicuuc.so is found, not the
/system.

Bug: 124218500
Test: The app can be launched successfully
Test: CtsJniTestCases
Change-Id: I67a50f0ad934be567a63d4038215546c9b4e5f7e
2019-02-13 15:31:06 +00:00
Ryan Prichard
40f18976db Merge "Only test tprel_missing_weak in dynamic binaries" 2019-02-13 00:26:51 +00:00
Christopher Ferris
e4cdbc4754 Refactor malloc common into distinct pieces.
The pieces:
- The malloc common shared by static and dynamic code (malloc_common.cpp).
- The code for shared libraries that includes any dlopen'ing
  (malloc_common_dynamic.cpp).
- The implementation of perfetto's heapprofd (malloc_heapprofd.cpp).

This makes it easier to see what's going on in the many different areas.
It should also make it easier to add the allocation capping option.

Other related changes:
- Update the unit tests for android_mallopt. All of the current options
  don't work on static binaries, so make sure that is reflected in the test.
- A few names changes to make sure that all code is consistent.

Test: Ran tests (malloc hooks/malloc debug/perfetto/bionic unit tests).
Change-Id: I0893bfbc0f83d82506fac5d1f37cf92fbdef6f59
2019-02-12 14:19:07 -08:00
Yi Kong
16f947281f Use no_libcrt property instead of hard coding projects to exclude
Test: m checkbuild
Change-Id: If34c72d37dc4077ca3e83135391256bc53d295b5
2019-02-12 09:49:23 -08:00