diff options
author | Fangrui Song <i@maskray.me> | 2022-12-04 15:06:34 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-04 15:06:34 -0800 |
commit | eecb22d8e1fe5ac6cc35ace63ae517c33ff40d85 (patch) | |
tree | 6acb1291ac262818868bba657cc058e27a81b5fc /llvm/unittests/BinaryFormat | |
parent | ee77b73c433992717f20e95e10ece542e7726dcf (diff) | |
download | llvm-eecb22d8e1fe5ac6cc35ace63ae517c33ff40d85.zip llvm-eecb22d8e1fe5ac6cc35ace63ae517c33ff40d85.tar.gz llvm-eecb22d8e1fe5ac6cc35ace63ae517c33ff40d85.tar.bz2 |
[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
Diffstat (limited to 'llvm/unittests/BinaryFormat')
0 files changed, 0 insertions, 0 deletions