[PATCH] D37718: [ELF] Handle references to garbage collected common symbols

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 18:23:56 PDT 2017


bd1976llvm added a comment.

In https://reviews.llvm.org/D37718#867277, @dmikulin wrote:

> Why is there a relocation for "unused" if it's marked not live?
>  Relocation section '.rela.noalloc' at offset 0x98 contains 1 entries:
>
>   Offset          Info           Type           Sym. Value    Sym. Name + Addend
>
> 000000000000  000200000001 R_X86_64_64       0000000000000004 unused + 0


The target of the relocation is "unused". The relocation patches a section that remains live.

This case commonly arises where the section that is being patched is informational and the linker can't garbage collect it e.g .debug_info.

p.s: strech goal for the brave - actually a linker could garbage collect these sections but it would be a lot of work.


https://reviews.llvm.org/D37718





More information about the llvm-commits mailing list