aboutsummaryrefslogtreecommitdiffstats
path: root/dos/dosexe.ld
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-07-19 16:17:04 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-07-19 16:20:23 -0700
commitdb8899d1faa6fc6e3ea8b89684e5a623df9909ed (patch)
treeb04a876eb9d9f0c8718831875c92f3aca3b16c77 /dos/dosexe.ld
parentccad6e87e9b9a51f3781cc6e4dc045525c5c5342 (diff)
downloadsyslinux-devel-db8899d1faa6fc6e3ea8b89684e5a623df9909ed.tar.gz
syslinux-devel-db8899d1faa6fc6e3ea8b89684e5a623df9909ed.tar.xz
syslinux-devel-db8899d1faa6fc6e3ea8b89684e5a623df9909ed.zip
dos: change the link procedure to use negative pointers below DGROUP
Use negative pointer values below DGROUP, i.e. for the .payload segment. This makes it a lot easier to figure out if we are dealing with pointers that shouldn't come from where they do, since the DGROUP and .payload segments no longer overlap, and in fact are congruent. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'dos/dosexe.ld')
-rwxr-xr-xdos/dosexe.ld10
1 files changed, 6 insertions, 4 deletions
diff --git a/dos/dosexe.ld b/dos/dosexe.ld
index 4612b30a..c67c5060 100755
--- a/dos/dosexe.ld
+++ b/dos/dosexe.ld
@@ -26,20 +26,22 @@ SECTIONS
__header_size = .;
__payload_lma = .;
- . = 0;
+ . = 0x100000000 - syslinux_ldlinux_size;
.payload : AT (__payload_lma) {
__payload_start = .;
- ldlinux_bin.o(.data)
+ *(.payload)
__payload_end = .;
}
__payload_len = __payload_end - __payload_start;
__payload_dwords = __payload_len >> 2;
- . = ALIGN(16);
- __text_lma = __payload_lma + .;
+ __text_lma = __payload_lma + syslinux_ldlinux_size;
__payload_sseg = (__payload_lma - __text_lma) >> 4;
_exe_text_seg = (__text_lma - __header_size) >> 4;
+ __assert1 = ASSERT((__payload_len == syslinux_ldlinux_size),
+ "syslinux_ldlinux_size must equal the size of .payload");
+
. = 0;
.text : AT (__text_lma) {
*(.text .stub .text.* .gnu.linkonce.t.*)