Only restrict order if both sections are in the script.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 20 Sep 2016 20:54:39 +0000 (20:54 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 20 Sep 2016 20:54:39 +0000 (20:54 +0000)
commit145569df6411e9fcff07fe5bc09afdf8fdc2be35
tree8e2078d9e47b7e9202d07706135f863b88446023
parente5bfa690d04a70fd3c6378401e3fb1ab5d4a3480
Only restrict order if both sections are in the script.

This matches gold and bfd behavior and is required to handle some scripts.

The script has to assume where PT_LOADs start in order to align that
spot. If we don't allow section it doesn't know about to move to the
middle, we can need more PT_LOADs and those will not be aligned.

llvm-svn: 282015
lld/ELF/LinkerScript.cpp
lld/test/ELF/linkerscript/orphans.s
lld/test/ELF/linkerscript/repsection-symbol.s
lld/test/ELF/linkerscript/sort-non-script.s [new file with mode: 0644]