llvm-project/llvm/test/Instrumentation
Fangrui Song eecb22d8e1 [SanitizerBinaryMetadata] Use weak __start_/__stop_ instead of dummy empty section
D130887 uses a dummy empty section `sanmd_covered` (with the SHF_GNU_RETAIN flag on
ELF) to prevent `undefined symbol: __start_sanmd_covered` if all `sanmd_covered`
are discarded by `ld --gc-sections` (in `-z start-stop-gc` mode).

The dummy `sanmd_covered` does not have the SHF_LINK_ORDER flag, so mixing it
with SHF_LINK_ORDER `sanmd_covered` causes an issue to GNU ld<2.36
(https://sourceware.org/bugzilla/show_bug.cgi?id=26256).

Similar to D98903 for SanitizerCoverage, let's make encapsulation symbols
undefined weak[1]. This additionally avoids size cost due to the dummy section and
symbol.

[1]: https://maskray.me/blog/2021-01-31-metadata-sections-comdat-and-shf-link-order

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D139276
2022-12-04 15:06:34 -08:00
..
AddressSanitizer Utils: Fix appending to global_ctors with program address spaces 2022-11-29 10:54:11 -05:00
BoundsChecking BoundsChecking: Convert tests to opaque pointers 2022-11-28 09:32:23 -05:00
DataFlowSanitizer DataFlowSanitizer: Convert most tests to opaque pointers 2022-11-27 20:10:57 -05:00
HWAddressSanitizer HWAsan: Convert tests to opaque pointers 2022-11-27 21:24:24 -05:00
HeapProfiler HeapProfiler: Convert tests to opaque pointers 2022-11-28 09:32:09 -05:00
InstrOrderFile [LegacyPM] Remove InstrOrderFileLegacyPass 2022-07-19 23:58:51 -07:00
InstrProfiling [PGO][AIX] Improve dummy var retention and allow -bcdtors:csect linking. 2022-10-21 16:32:42 +00:00
JustMyCode [JMCInstrument] rename ELF section name from ".just.my.code" to ".data.just.my.code" 2022-10-19 10:49:54 -07:00
MemorySanitizer MemorySanitizer: Convert tests to opaque pointers 2022-11-27 21:24:24 -05:00
PoisonChecking PoisonChecking: Convert tests to opaque pointers 2022-11-28 09:32:15 -05:00
SanitizerBinaryMetadata [SanitizerBinaryMetadata] Use weak __start_/__stop_ instead of dummy empty section 2022-12-04 15:06:34 -08:00
SanitizerCoverage SanitizerCoverage: Convert tests to opaque pointers 2022-11-27 19:36:00 -08:00
ThreadSanitizer ThreadSanitizer: Convert tests to opaque pointers 2022-11-27 20:55:15 -05:00
cgprofile.ll [LegacyPM] Remove CGProfileLegacyPass 2022-07-16 00:39:56 -07:00