[ELF] - Fix for PR28976 - Corrupted section contents when using linker scripts
authorGeorge Rimar <grimar@accesssoftek.com>
Fri, 19 Aug 2016 15:46:28 +0000 (15:46 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Fri, 19 Aug 2016 15:46:28 +0000 (15:46 +0000)
commit3e6833b4b236e46ccf304a7b118615036d7c582b
treee81dea4b22796c8d12fa425631a4d426404d7f37
parent57b12d3876af84f1f394ab5183ec9fdfe15f45a5
[ELF] - Fix for PR28976 - Corrupted section contents when using linker scripts

This is fix for PR28976.

Problem was that in scanRelocs, we computed relocation offset too early
for case when linkerscript was used. Patch fixes the issue
delaying the calculation.

Differential revision: https://reviews.llvm.org/D23655

llvm-svn: 279264
lld/ELF/InputSection.cpp
lld/ELF/OutputSections.cpp
lld/ELF/Relocations.cpp
lld/test/ELF/linkerscript/Inputs/linkerscript-merge-sections-reloc.s [new file with mode: 0644]
lld/test/ELF/linkerscript/linkerscript-merge-sections-reloc.s [new file with mode: 0644]