Commit graph

14 commits

Author SHA1 Message Date
Elliott Hughes
ec9f023f41 Add invalid riscv64 ELF files for the linker tests.
The libtest_empty.so was built by the "libtest_empty" build rule, and
the other files are copies of that with small edits made by the toybox
hexedit tool. I worked out what to edit in each case from a combination
of "what does the name imply?" and "what does a diff of the xxd output
of the corresponding two arm64 files show?".

I failed to produce a working (by which I mean "failing") local-tls
file despite my best efforts. I'm not sure what exactly it was about the
gold-generated files we didn't like, because the commentary implies that
this would be problematic:

    39: 0000000000000004     4 TLS     LOCAL  DEFAULT   12 tls_var_2

But it loads without complaint.

Test: ran locally
Change-Id: I3b9b2b4db1f8827243541cf13380c6ceb840f123
2022-11-16 00:52:26 +00:00
Ryan Prichard
8ea6af53e2 Always process TLS relocs using general code path
This is important for enabling the error about unsupported TLS
relocations to local symbols. The fast path tends to skip this error,
because it fails during lookup_symbol(). Add a test for this error.

I didn't see a performance regression in the linker_relocation
benchmark.

Bug: http://b/226978634
Test: m bionic-unit-tests
Change-Id: Ibef9bde2973cf8c2d420ecc9e8fe2c69a5097ce2
2022-03-25 15:51:11 -07:00
Elliott Hughes
6a65ccdf52 Remove mips test workarounds.
The mips/mips64 targets were never able to pass these tests, and the
supported architectures don't need any of these workarounds.

Test: treehugger
Change-Id: I640a8b7a98ae13d9d9cdb09b0fbef61d31d4c79a
2020-02-13 09:48:14 -08:00
Dimitry Ivanov
bfe8680564 Remove libc++ dependency from prebuilt test-libs
Bug: http://b/27549327
Test: run bionic-unit-tests --gtest_filter=dl*:Dl* on angler
Change-Id: Ia09ed2c00213bc07bf2a4c772e675419f7a30cb3
2017-01-23 14:47:45 -08:00
Dimitry Ivanov
416158db60 Add original prebuilt test libraries
This is the library used to produce invalid prebuilt libraries
for loader tests.

Bug: http://b/30795430
Test: not necessary - these are added for reference
Change-Id: I06e681bf826e59a76da9b49d84d26dee34920d49
2016-11-16 14:02:49 -08:00
Dimitry Ivanov
816676e70d Add test for libraries with textrels
Make sure android fails to load them.

Bug: http://b/30795430
Test: bionic-unit-tests --gtest_filter=dlfcn.dlopen_invalid*
Test: cts-tradefed run singleCommand cts --skip-preconditions -m CtsBionicTestCases
Change-Id: Id0ebdf336b2f297007479ceb1bbccf778a7ca3f2
2016-10-19 14:21:42 -07:00
Nikola Veljkovic
44a654446e [mips] Add missing linker shdr tests
Test: bionic-unit-tests for mips, mips64.
Change-Id: I8ed5f03df8d129e74fa04be2b203bd113a381888
2016-08-16 18:52:06 +00:00
Dimitry Ivanov
559583469c linker: add test for zeroed out shdr_table_
Bug: http://b/30795430
Change-Id: I86b658d01b64670d3e702ddb1d3f9db4f75d784f
Test: bionic-unit-tests --gtest_filter=dlfcn.dlopen_invalid*
2016-08-15 14:06:04 -07:00
Dimitry Ivanov
4623044517 linker: add test for zero shdr offset
Bug: http://b/30795430
Change-Id: I03853257c4b632ad9daaf1e90f9620678397cff0
Test: bionic-unit-tests --gtest_filter=dlfcn.dlopen_invalid*
2016-08-15 13:42:47 -07:00
Dimitry Ivanov
8bdf70e6e4 linker: add test for empty shdr table
Bug: http://b/30795430
Change-Id: Id839c22f88276f31e0615bc2a67d75e27a9aa7c6
Test: run bionic-unit-tests --gtest_filter=dlfcn.dlopen_invalid*
2016-08-15 11:30:45 -07:00
Dimitry Ivanov
c9a95613a9 linker: add test for zero shstrndx
Bug: http://b/30166532
Bug: http://b/30795430
Test: bionic-unit-tests --gtest_filter=dlfcn.dlopen_invalid*
Change-Id: I4cec73635cf403df9dd60b9a294d2298bb0abe3d
2016-08-15 10:29:50 -07:00
Dimitry Ivanov
cb86c3128f linker: add test for zero e_shentsize
Bug: http://b/30166532
Bug: http://b/30795430
Change-Id: I249c081563f0ca7bcc799d8445a53683616eaa4e
Test: run bionic-unit-tests --gtest_filter=dlfcn.dlopen_invalid*
2016-08-12 15:28:42 -07:00
Dimitry Ivanov
972e3d0787 Add test for misaligned section header
Make sure linker does not crash when dlopening
elf-file with odd section header offset.

Bug: http://b/30795430
Bug: http://b/30687964
Test: bionic-unit-tests --gtest_filter=dlfcn.dlopen_invalid*
Change-Id: If59cb6da85b8752a69dc5687de85f9a9b74c92b4
2016-08-12 14:48:15 -07:00
Dimitry Ivanov
9700babc05 linker: disallow W + E PT_LOAD segments
No mapped segment from the elf file can be writable and
executable at the same time. This commit adds a check
for malformed PT_LOAD segments in the elf-files.

Bug: http://b/30146890
Test: run bionic-unit-tests --gtest_filter=dlfcn.*
Change-Id: Ia23acbe5a48780b65d7e4a50bbe024cd528079f4
2016-08-11 17:24:47 -07:00