summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-09-30 00:16:11 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-09-30 00:16:11 +0000
commitbe6073345e68981bcb6ea73c464b5065934cdb0a (patch)
tree49c4164e2dc822b5143eeb2994267be57329adba /lld/ELF/LinkerScript.cpp
parent4b36e0c4096ec6685c9ec8acc2b59ddd3ff0cd39 (diff)
downloadbcm5719-llvm-be6073345e68981bcb6ea73c464b5065934cdb0a.tar.gz
bcm5719-llvm-be6073345e68981bcb6ea73c464b5065934cdb0a.zip
Start linker scripts at 0.
We were implicitly creating space for the headers. That is not the behaviour of bfd, which requires the script to use SIZEOF_HEADERS. The difference is important for scripts that don't use SIZEOF_HEADERS and expect the first section to be at 0. llvm-svn: 282818
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index b979d06b927..5cdee7082e1 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -595,7 +595,7 @@ void LinkerScript<ELFT>::assignAddresses(std::vector<PhdrEntry<ELFT>> &Phdrs) {
}
// Assign addresses as instructed by linker script SECTIONS sub-commands.
- Dot = getHeaderSize();
+ Dot = 0;
for (const std::unique_ptr<BaseCommand> &Base : Opt.Commands) {
if (auto *Cmd = dyn_cast<SymbolAssignment>(Base.get())) {
OpenPOWER on IntegriCloud