[ELF] Do not merge sections in case of relocatable object generation
authorSimon Atanasyan <simon@atanasyan.com>
Wed, 5 Oct 2016 07:49:18 +0000 (07:49 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Wed, 5 Oct 2016 07:49:18 +0000 (07:49 +0000)
commit02b9c3f8c35c8e3d03e1ded3e6a3147205f7e6c0
tree473f635b9fe668a4994311b746a261576670732e
parent47cf72c34c5b11bef4717377dc1c5673d3f6a2cb
[ELF] Do not merge sections in case of relocatable object generation

Do not merge sections if generating a relocatable object. It makes
the code simpler because we do not need to update relocations addends
to reflect changes introduced by merging. Instead of that we write
such "merge" sections into separate OutputSections and keep SHF_MERGE
/ SHF_STRINGS flags and sh_entsize value to be able to perform merging
later during a final linking.

Differential Revision: http://reviews.llvm.org/D25066

llvm-svn: 283300
lld/ELF/InputFiles.cpp
lld/ELF/OutputSections.cpp
lld/test/ELF/merge-reloc.s [new file with mode: 0644]