[ELF] - Another fix for "LLD crashes with --emit-relocs when trying to proccess ...
authorGeorge Rimar <grimar@accesssoftek.com>
Fri, 23 Mar 2018 09:18:31 +0000 (09:18 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Fri, 23 Mar 2018 09:18:31 +0000 (09:18 +0000)
commit54634f19907efa692681e80f3b134808c10b2e35
treec17272a57ad6d286d66253ffca993923364dd374
parente1a64fe95cfbe925da52f512fb3f4b2011716edb
[ELF] - Another fix for "LLD crashes with --emit-relocs when trying to proccess .eh_frame"

This fixes PR36367 which is about segfault when --emit-relocs is
used together with .eh_frame sections which happens because
of reordering of regular and .rel[a] sections.

Path changes loop that iterates over input sections to create
relocation target sections first.

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

llvm-svn: 328299
lld/ELF/LinkerScript.cpp
lld/test/ELF/emit-relocs-eh-frame.s [new file with mode: 0644]
lld/test/ELF/emit-relocs-shared.s
lld/test/ELF/emit-relocs.s
lld/test/ELF/linkerscript/eh-frame-emit-relocs.s [new file with mode: 0644]