summaryrefslogtreecommitdiff
path: root/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-28 21:23:25 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-28 21:23:25 +0000
commitae1a339de31cf4065777531959a11e55a2e5fa00 (patch)
treeae204c76257fe2799a8fdc5fcb12a2523805c7c8 /ELF/ScriptParser.cpp
parente30c72b844bec93f6c197ea6c7c8cd0188964208 (diff)
Notes
Diffstat (limited to 'ELF/ScriptParser.cpp')
-rw-r--r--ELF/ScriptParser.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/ELF/ScriptParser.cpp b/ELF/ScriptParser.cpp
index c1176ccfa8d5..4263944981f2 100644
--- a/ELF/ScriptParser.cpp
+++ b/ELF/ScriptParser.cpp
@@ -151,6 +151,7 @@ static ExprValue add(ExprValue A, ExprValue B) {
}
static ExprValue sub(ExprValue A, ExprValue B) {
+ // The distance between two symbols in sections is absolute.
if (!A.isAbsolute() && !B.isAbsolute())
return A.getValue() - B.getValue();
return {A.Sec, false, A.getSectionOffset() - B.getValue(), A.Loc};
@@ -707,8 +708,6 @@ OutputSection *ScriptParser::readOutputSectionDescription(StringRef OutSec) {
if (consume(">"))
Cmd->MemoryRegionName = next();
- else if (peek().startswith(">"))
- Cmd->MemoryRegionName = next().drop_front();
Cmd->Phdrs = readOutputSectionPhdrs();