[lld] r321458 - Add a comment about subtracting two non abs symbols. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 26 10:11:14 PST 2017
Author: rafael
Date: Tue Dec 26 10:11:14 2017
New Revision: 321458
URL: http://llvm.org/viewvc/llvm-project?rev=321458&view=rev
Log:
Add a comment about subtracting two non abs symbols. NFC.
Modified:
lld/trunk/ELF/ScriptParser.cpp
Modified: lld/trunk/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ScriptParser.cpp?rev=321458&r1=321457&r2=321458&view=diff
==============================================================================
--- lld/trunk/ELF/ScriptParser.cpp (original)
+++ lld/trunk/ELF/ScriptParser.cpp Tue Dec 26 10:11:14 2017
@@ -151,6 +151,7 @@ static ExprValue add(ExprValue A, ExprVa
}
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};
More information about the llvm-commits
mailing list