[ELF] Always use Script::assignAddresses()
authorPeter Smith <peter.smith@linaro.org>
Wed, 19 Apr 2017 12:46:32 +0000 (12:46 +0000)
committerPeter Smith <peter.smith@linaro.org>
Wed, 19 Apr 2017 12:46:32 +0000 (12:46 +0000)
commitcbfe9e946fd04d57145f35e2289c595a4a498f0b
treee83e6cdbb3cd06983628310700024b3c35a6cd3f
parentcb89513bc74257178e8adb09029b64ab8b52bed5
[ELF] Always use Script::assignAddresses()

This change fabricates linker script commands for the case where there is
no linker script SECTIONS to control address assignment. This permits us
to have a single Script->assignAddresses() function.

There is a small change in user-visible-behavior with respect to the
handling of .tbss SHT_NOBITS, SHF_TLS as the Script->assignAddresses()
requires setDot() to be called with monotically increasing addresses.
The tls-offset.s test has been updated so that the script and non-script
results match.

This change should make the non-script behavior of lld closer to an
equivalent linker script.

Differential Revision: https://reviews.llvm.org/D31888

llvm-svn: 300687
lld/ELF/LinkerScript.cpp
lld/ELF/LinkerScript.h
lld/ELF/Writer.cpp
lld/test/ELF/tls-offset.s