This fixes PR37735.
As addends were not updated in that case, the debug information in the relocatable output became corrupted.
Differential D48929
[ELF] Update addends in non-allocatable sections for REL targets when creating a relocatable output. ikudrin on Jul 4 2018, 3:30 AM. Authored by
Details
This fixes PR37735. As addends were not updated in that case, the debug information in the relocatable output became corrupted.
Diff Detail
Event Timeline
Comment Actions
Comment Actions This LGTM. The minor suggestion is below.
Comment Actions Note that the interaction with --compress-debug-sections={zlib,zstd} is not handled in this patch. For relocatable linking of .rel.debug_* sections, the implicit addends are not applied to the output. Writer<ELFT>::run maybeCompress OutputSection::writeTo InputSection::writeTo relocate # relocations is empty writeSections OutputSection::writeTo InputSection::writeTo if SHT_REL copyRelocations addReloc R_ABS elif non-compress relocate relocateNonAllocForRelocatable handle R_ABS Comment Actions Filed https://github.com/llvm/llvm-project/issues/66738 and pushed 345f532f3fe9bd4b6d55a490683455ee542d90d9 to add a test demonstrating the issue. |
Maybe I would make it even shorter: