[COFF] Don't produce base relocs for discardable sections
authorMartin Storsjo <martin@martin.st>
Thu, 19 Jul 2018 04:25:22 +0000 (04:25 +0000)
committerMartin Storsjo <martin@martin.st>
Thu, 19 Jul 2018 04:25:22 +0000 (04:25 +0000)
commitc35e4bf7ebd2844740bb28f3273742295e61b0a5
tree5f68780168ca010ab47d461ec0590c80d33781c5
parent7a6295f2e1639d11416be38ae184478d207bb030
[COFF] Don't produce base relocs for discardable sections

Dwarf debug info contains some data that contains absolute addresses.
Since these sections are discardable and aren't loaded at runtime,
there's no point in adding base relocations for them.

This makes sure that after stripping out dwarf debug info, there are no
base relocations that point to nonexistent sections.

Differential Revision: https://reviews.llvm.org/D49350

llvm-svn: 337438
lld/COFF/Writer.cpp
lld/test/COFF/debug-reloc.s [new file with mode: 0644]