summaryrefslogtreecommitdiff
path: root/dos
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-04-01 12:59:04 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2011-04-01 12:59:04 -0700
commit6fa865966e7121ef7d430ac5f8916993300f5e1b (patch)
tree6331edafbd5d55ba621abf1f568efc3df8ad1153 /dos
parent0620743d1e54cf48aa8e5cf5636739addae49d60 (diff)
downloadsyslinux-6fa865966e7121ef7d430ac5f8916993300f5e1b.tar.gz
ld: Use ABSOLUTE() when taking differences between relative symbols
binutils 2.21.51.0.6, and possibly other versions, generate the wrong result when subtracting two section-relative symbols (the final result ends up having the base of the section incorrectly added to it.) Work around this by using ABSOLUTE() on the symbols to force the result to become absolute. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'dos')
-rw-r--r--dos/dosexe.ld6
1 files changed, 3 insertions, 3 deletions
diff --git a/dos/dosexe.ld b/dos/dosexe.ld
index 833368aa..76bfc758 100644
--- a/dos/dosexe.ld
+++ b/dos/dosexe.ld
@@ -27,12 +27,12 @@ SECTIONS
__payload_lma = .;
. = 0x100000000 - syslinux_ldlinux_size;
- __payload_start = .;
.payload : AT (__payload_lma) {
+ __payload_start = .;
*(.payload)
+ __payload_end = .;
}
- __payload_end = .;
- __payload_len = __payload_end - __payload_start;
+ __payload_len = ABSOLUTE(__payload_end) - ABSOLUTE(__payload_start);
__payload_dwords = __payload_len >> 2;
__text_lma = __payload_lma + syslinux_ldlinux_size;