Commit graph

21219 commits

Author SHA1 Message Date
Elliott Hughes
dfcb82d92d Clean up __isthreaded.
__isthreaded is annoying for ARC++ and useless for everyone. Just hard-code
the value in ndk_cruft for LP32 and be done with it.

Bug: N/A
Test: builds
Change-Id: I08f11a404bbec55ed57cb1e18b5116163c7d7d13
2017-05-11 15:29:03 -07:00
Treehugger Robot
0e986b8d5d Merge "Fix clang-tidy perfomrance warnings." 2017-05-11 02:46:43 +00:00
wy
828b9e162f Fix clang-tidy perfomrance warnings.
Change-Id: Ibf3d32a5ba1cb70158d857be3d20aa3d1a870341
Test: build with WITH_TIDY=1
2017-05-10 15:57:26 -07:00
Treehugger Robot
a93fcd0394 Merge "greylist is no longer enabled by default." 2017-05-10 02:33:30 +00:00
Treehugger Robot
9259c5bde6 Merge "Remove known failures from arm ifunc tests" 2017-05-10 02:27:57 +00:00
Treehugger Robot
3c71e1ae18 Merge "Cope with AT_SYSINFO not being set on x86." 2017-05-10 01:28:55 +00:00
Jiyong Park
37b91af0f3 greylist is no longer enabled by default.
greylist is needed only for application namepaces. Since we started using
linker-namesapces for vendors and other platform apps linker should not
enable greylist workaround by default.

Bug: http://b/37731053
Bug: https://issuetracker.google.com/38146125
Test: sailfish builds and boots
Test: bionic-unit-tests and linker-unit-tests pass
Change-Id: Iee83db6fb1ae754f5ade18491321d9bca3b5ead4
(cherry picked from commit e8ffe56a9c)
2017-05-09 17:59:00 -07:00
Elliott Hughes
4119281323 Merge "Zero-initialize user_desc for __set_thread_area." 2017-05-09 23:59:09 +00:00
Elliott Hughes
b291d08af2 Zero-initialize user_desc for __set_thread_area.
The kernel does seem to read some of the "unused" fields if only to do
basic validity checks.

valgrind complained about this, and I'm not convinced it's spurious.

Bug: http://b/38034461
Test: ran tests
Change-Id: I077fcc75bf0738491242166fc4576a9693ce18a5
2017-05-09 14:39:24 -07:00
Elliott Hughes
9ae23720aa Cope with AT_SYSINFO not being set on x86.
Bug: http://b/38034461
Test: ran dexdump under valgrind on x86
Change-Id: I6a54c7ed4fe4e68731e099d9569ab788379820f8
2017-05-09 14:26:30 -07:00
Christopher Ferris
ea5ee452c9 Merge "Add new memchr/strrchr tests." 2017-05-09 16:40:31 +00:00
Christopher Ferris
2f030af250 Add new memchr/strrchr tests.
There are new optimizations for these functions, so adding some extra
testing for these routines.

Also, clean up the strchr test slightly with some extra comments.

Test: Ran new tests on glibc version, and on angler.
Change-Id: I41bf4e5e2c84295cc1ce9d2226ed57c2d228d7b8
2017-05-08 20:10:32 -07:00
Treehugger Robot
1f9e648878 Merge "Make raise/abort work with stale cached pid/tid values." 2017-05-06 00:56:21 +00:00
Josh Gao
bf2af69fb2 Make raise/abort work with stale cached pid/tid values.
Switch raise to using tgkill with direct syscalls of getpid/gettid,
and switch abort to use raise(SIGABRT).

Bug: http://b/37769298
Test: debuggerd_test
Change-Id: If6f9d17fd8ae6177e742dc9f2f44bd78539431ba
2017-05-05 14:25:24 -07:00
Treehugger Robot
e6691d3470 Merge changes from topic 'mips_seccomp_fixes'
* changes:
  [MIPS64] Enable necessary mips64 syscalls in seccomp whitelist
  Fix MIPS seccomp definitions for PRIMARY and SECONDARY arch
2017-05-05 18:31:33 +00:00
Lazar Trsic
dd5bd456fb [MIPS64] Enable necessary mips64 syscalls in seccomp whitelist
Allow execution of: newfstatat, fstat and cacheflush syscalls
for mips64 arch.

Test: Boot mips64 emulator to homescreen with 3.18 kernel.
emulator -kernel prebuilts/qemu-kernel/mips64/3.18/kernel-qemu2

Change-Id: Ib5d6b0060f3e17b64d86fc944aa83a5240d512f8
2017-05-05 15:37:11 +02:00
Lazar Trsic
22b4351d5e Fix MIPS seccomp definitions for PRIMARY and SECONDARY arch
Set correct values for PRIMARY and SECONDARY arch definitions
to match LE MIPS architectures.
This change is resolving boot problem for mips32 arch with 3.18 kernel.
This also fixes mips64 issue related to PRIMARY_ARCH definition,
but in order to boot to home screen it needs additional syscalls whitelisted
which will be introduced in separate patch.

Tested on emulator:
emulator -kernel prebuilts/qemu-kernel/mips/3.18/kernel-qemu2

Change-Id: I68dfd136c22141933a8a8c5336db01a02f00b0df
2017-05-05 15:27:58 +02:00
Treehugger Robot
86b3494e3b Merge "libc: clean up ARM64 copyright notices" 2017-05-05 07:15:09 +00:00
Jake Weinstein
28285f5338 libc: clean up ARM64 copyright notices
Test: None needed

Change-Id: I3626a92329e954f67bada6ed73f3033225bbfef5
2017-05-04 12:59:53 -04:00
Treehugger Robot
05fd20c797 Merge changes Ia7200bf0,I86999bb7
* changes:
  versioner: fix leak.
  versioner: add symlink for dependencies.
2017-05-04 04:08:22 +00:00
Dimitry Ivanov
c42b4bb097 Remove known failures from arm ifunc tests
Since clang does not produce IRELATIVE relocations
this test started passing when we switched away from gcc
This is still a problem because it now leads to
situation where static ifuncs become globally visible
but this is a different problem.

Test: bionic-unit-tests --gtest_filer=dl*
Change-Id: Id27ba5093b88519c00acbc43ab8a991a671a9f51
2017-05-03 11:01:00 -07:00
Christopher Ferris
5725481f1e Merge "Move libc_log code into libasync_safe." 2017-05-03 17:43:35 +00:00
Dimitry Ivanov
846924ae95 Merge "Add ifunc for variable test-case" 2017-05-03 16:11:27 +00:00
Christopher Ferris
7a3681e5b6 Move libc_log code into libasync_safe.
This library is used by a number of different libraries in the system.
Make it easy for platform libraries to use this library and create
an actual exported include file.

Change the names of the functions to reflect the new name of the library.

Run clang_format on the async_safe_log.cpp file since the formatting is
all over the place.

Bug: 31919199

Test: Compiled for angler/bullhead, and booted.
Test: Ran bionic unit tests.
Test: Ran the malloc debug tests.
Change-Id: I8071bf690c17b0ea3bc8dc5749cdd5b6ad58478a
2017-05-03 08:50:43 -07:00
Treehugger Robot
6323cfad74 Merge "Shared namespaces inherit parent ns properties" 2017-05-03 01:28:35 +00:00
Dimitry Ivanov
f1cb669a9c Shared namespaces inherit parent ns properties
Make shared namespace inherit namespace links and
search/permitted paths from the parent namespace.

Bug: http://b/37854032
Test: bionic_unit_tests --gtest_filter=dl*:Dl*
Change-Id: I174661d4a1dd0cbe4a378179073719aa955f3592
(cherry picked from commit ec43dd6c36)
2017-05-02 16:42:28 -07:00
Dimitry Ivanov
21975b2861 Add ifunc for variable test-case
Also move ifunc tests to clang and c++.

Test: bionic-unit-tests --gtest_filter=dlfcn.ifunc*
Change-Id: I008c4fc01470c8e4d314003c03a2b63ff9bf7fd8
2017-05-02 16:35:20 -07:00
Yabin Cui
3f4735fafa Merge "Fix pthread_barrier_smoke test (part 2)." 2017-05-02 23:20:32 +00:00
Yabin Cui
ab4cddc329 Fix pthread_barrier_smoke test (part 2).
Bug:http://b/37652807
Test: run bionic-unit-tests.
Change-Id: Iaea553177956c5d08f754210273637f69d888c20
2017-05-02 16:18:13 -07:00
Treehugger Robot
85408ef2da Merge "Fix test compile errors after LLVM rebase" 2017-05-02 22:25:59 +00:00
Treehugger Robot
5c7107434b Merge "Fix pthread_barrier_smoke test." 2017-05-02 21:51:42 +00:00
Yi Kong
2d3122c90b Fix test compile errors after LLVM rebase
After the new rebase of Clang, we now support the alloc_size attribute,
so we can remove the warning about switching to alloc_size once Clang
has support.

Also fix an issue where 'false' is returned in a main method.

Test: make cts
Bug: 37752547
Change-Id: I32ee814aaa0338567cb8174a68d7ee1bfece2f75
2017-05-02 21:14:42 +00:00
Yabin Cui
d5c04c5ebb Fix pthread_barrier_smoke test.
Bug: http://b/37652807
Test: run bionic-unit-tests.
Change-Id: Id7245223bc2a284efed6e710892b58947ef5d555
2017-05-02 12:57:39 -07:00
Treehugger Robot
ca5e0f49ca Merge "versioner: disable container overflow checks" 2017-05-02 03:50:29 +00:00
Treehugger Robot
87a47e1bb2 Merge "linker: add android_get_exported_namespace" 2017-05-02 01:37:04 +00:00
Andreas Gampe
d10d3eece1 versioner: disable container overflow checks
Temporary workaround.

Bug: 37775238
Test: ASAN_OPTIONS= SANITIZE_HOST=address m
Change-Id: If9e9df45d83f8412caafcece87337a5c9df3a1c8
2017-05-01 16:31:51 -07:00
Treehugger Robot
fd478a8cba Merge "fix half-deleted comments in tests" 2017-05-01 20:17:21 +00:00
George Burgess IV
cf44343c1a fix half-deleted comments in tests
they were half-deleted in If341a27756d608a0fa77ba6518e9bcc725f7632c.

Bug: None
Test: mma
Change-Id: I4e0c8208a7f2a55d273f4c87adca1d755dc98b77
2017-05-01 11:20:31 -07:00
Elliott Hughes
c15117658b Merge "Restore ELF32_ST_INFO/ELF64_ST_INFO." 2017-05-01 14:42:52 +00:00
Elliott Hughes
d390df1dbc Restore ELF32_ST_INFO/ELF64_ST_INFO.
Mistakenly removed years ago, along with its genuinely duplicated companions.
This patch also redefines one of those rather than use the Linux uapi header
definition, which leads to signed/unsigned warnings in calling code.

Bug: https://github.com/android-ndk/ndk/issues/377
Test: ran tests
Change-Id: Ib25b17949f04969f12b945ca88ab87d080677cf9
2017-04-30 22:56:10 -07:00
Treehugger Robot
dfe0fa4151 Merge "Include the libc/kernel/android/scsi headers in the NDK." 2017-04-28 02:48:02 +00:00
Jiyong Park
01de74e76d linker: add android_get_exported_namespace
Depending on how ld.config.txt is configured, there can be multiple
built-in namespaces created by the linker from the beginning of a
process. android_get_exported_namespace is a platform only API for
getting a handle (android_namespace_t*) to one of the built-in namespaces
with given name. The returned namespace can then be given to
android_dlopen_ext in order to explicitly specify the target namespace
where the library is searched and loaded from.

Note that this function only returns 'exported' namespaces created via
ld.config.txt file. In order to export a namespace, the visible property
should be set to true:

namespace.<name>.visible = true

Namespaces are hidden by default. Hidden namespaces and namespaces
that are created programmatically, notably 'classloader-namespace',
aren't returned by this function.

Bug: 36851137
Test: confirmed that namespaces created with ld.config.txt is retrieved.
Test: linker-unit-tests passes
Merged-in: I714b510fa24f77e42c3dfc4c827b3befa8bb2951
Change-Id: I0d05fa7e0e116009edf8ea362ab46774bc617cbf
(cherry picked from commit d7c4832e6a)
2017-04-28 10:14:28 +09:00
Josh Gao
b50b8c8886 versioner: fix leak.
Replace an intentional leak of a buffer allocated by realpath with a use
of android::base::Realpath.

Bug: http://b/37727515
Test: tools/versioner/run_tests.py
Change-Id: Ia7200bf0e1c485050e860e21ff15784941366bec
2017-04-27 17:25:32 -07:00
Josh Gao
0be1dabfc6 versioner: add symlink for dependencies.
Add a symlink where dependencies used to live, so that `versioner`
works.

Test: versioner
Test: tools/versioner/run_tests.py
Change-Id: I86999bb79baad16039709306591cb9540fb533ca
2017-04-27 17:25:23 -07:00
Elliott Hughes
2fad0d5927 Include the libc/kernel/android/scsi headers in the NDK.
We have some non-upstream (but Android common kernel) scsi headers to include
in the NDK.

Bug: N/A
Test: checked out/soong/ndk/sysroot
Change-Id: If7611e1e554ada63f266ec99d95dfedb99562ae9
2017-04-27 16:26:55 -07:00
Elliott Hughes
306ea55952 Merge "Compare Pss of tested library in VerifyMemorySaving" 2017-04-27 15:40:37 +00:00
Treehugger Robot
36d5c54b5e Merge "Make dl_iterate_phdr weak in libdl." 2017-04-27 07:44:14 +00:00
Treehugger Robot
9cc08e0a1f Merge "watchpoint_imprecise test: set 4-byte watchpoints on 32-bit arches" 2017-04-27 00:42:15 +00:00
Zhenhua WANG
81aad0058c Compare Pss of tested library in VerifyMemorySaving
DlExtRelroSharingTest.VerifyMemorySaving verifies whether
android_dlopen_ext(ANDROID_DLEXT_USE_RELRO) really saves memory.

This patch compares Pss of the tested library rather than total
Pss of the process, in case different behavior of dlopen() and
android_dlopen_ext() introduces random Pss usage.

Test: DlExtRelroSharingTest.VerifyMemorySaving

Change-Id: I696eca736018fca5d9ec9385ac1c79ced280281d
2017-04-26 17:06:32 -07:00
Yi Kong
82f7208ac0 Merge "Update bionic after Clang rebase" 2017-04-26 23:00:41 +00:00