[PATCH] D122463: [ELF] --emit-relocs: fix missing STT_SECTION when the first input section is synthetic
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 24 23:35:04 PDT 2022
MaskRay created this revision.
MaskRay added reviewers: ikudrin, peter.smith.
Herald added subscribers: StephenFan, arichardson, emaste.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
addSectionSymbols suppresses the STT_SECTION symbol if the first input section
is non-SHF_MERGE synthetic. This is incorrect when the first input section is synthetic
while a non-synthetic input section exists:
- `.bss : { *(COMMON) *(.bss) }` (abc388ed3cf0ef7e617ebe243d3b0b32d29e69a5 <https://reviews.llvm.org/rGabc388ed3cf0ef7e617ebe243d3b0b32d29e69a5> regressed the case because COMMON symbols precede .bss in the absence of a linker script)
- Place a synthetic section in another section: `.data : { *(.got) *(.data) }`
Fix the issue by checking every input section.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D122463
Files:
lld/ELF/Writer.cpp
lld/test/ELF/emit-relocs-synthetic.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122463.418137.patch
Type: text/x-patch
Size: 3745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220325/34561120/attachment.bin>
More information about the llvm-commits
mailing list