Linker script: fix crash when discarding section
authorEugene Leviant <evgeny.leviant@gmail.com>
Fri, 23 Sep 2016 13:17:16 +0000 (13:17 +0000)
committerEugene Leviant <evgeny.leviant@gmail.com>
Fri, 23 Sep 2016 13:17:16 +0000 (13:17 +0000)
commitd4dea164dd453f567d9d33f3c158c33d6904987f
treea04b9fb3517ab599aa9cf7dd45c934d83bda22b5
parentc8ccd1f1c5cba21a36e65f284929499b2f7a31b5
Linker script: fix crash when discarding section

If section contains local symbols ldd crashes, because local
symbols are added to symbol table before section is discarded
by linker script processor. This patch calls copyLocalSymbols()
after createSections, so discarded section symbols are not copied

llvm-svn: 282244
lld/ELF/Writer.cpp
lld/test/ELF/linkerscript/discard-section.s [new file with mode: 0644]