OSDN Git Service

[ELF] Drop .rel[a].debug_gnu_pub{names,types} for --gdb-index --emit-relocs
authorFangrui Song <i@maskray.me>
Tue, 12 Jan 2021 08:07:28 +0000 (00:07 -0800)
committerFangrui Song <i@maskray.me>
Tue, 12 Jan 2021 08:07:28 +0000 (00:07 -0800)
commit93ad0edf674125f19177054d8331a5e8910d3d98
tree086816769e49eba719b943d90822c2efeaea2304
parentdf74c001fa5bd4874d0d88724e6cf726ed552904
[ELF] Drop .rel[a].debug_gnu_pub{names,types} for --gdb-index --emit-relocs

Fixes PR48693: --emit-relocs keeps relocation sections. --gdb-index drops
.debug_gnu_pubnames and .debug_gnu_pubtypes but not their relocation sections.
This can cause a null pointer dereference in `getOutputSectionName`.

Also delete debug-gnu-pubnames.s which is covered by gdb-index.s

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D94354
lld/ELF/SyntheticSections.cpp
lld/test/ELF/debug-gnu-pubnames.s [deleted file]
lld/test/ELF/gdb-index.s