mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 17:01:00 +08:00
Result of subtracting two symbols should be absolute.
When two linker script symbols are subtracted, the result should be absolute. This is the behavior of binutils' ld. Patch by Erick Reyes! llvm-svn: 321390
This commit is contained in:
@@ -151,6 +151,8 @@ static ExprValue add(ExprValue A, ExprValue B) {
|
||||
}
|
||||
|
||||
static ExprValue sub(ExprValue A, ExprValue B) {
|
||||
if (!A.isAbsolute() && !B.isAbsolute())
|
||||
return A.getValue() - B.getValue();
|
||||
return {A.Sec, false, A.getSectionOffset() - B.getValue(), A.Loc};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user