summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-07-27 21:35:35 -0700
committerH. Peter Anvin <hpa@zytor.com>2019-07-27 21:35:35 -0700
commitfbeaf65b4a93933e6dd7ac3a95e763252a14127c (patch)
tree9904fad92a9dbec651ca3f0bce79efc4bd7a5762
parent960d45308c2aa25a8f25785056408cf5bd99f0ae (diff)
downloadsamples-fbeaf65b4a93933e6dd7ac3a95e763252a14127c.tar.gz
samples-fbeaf65b4a93933e6dd7ac3a95e763252a14127c.tar.xz
samples-fbeaf65b4a93933e6dd7ac3a95e763252a14127c.zip
exe.ld: clean up and fix the dynamic tags
-rw-r--r--exe.ld30
1 files changed, 12 insertions, 18 deletions
diff --git a/exe.ld b/exe.ld
index 56363d8..810d39a 100644
--- a/exe.ld
+++ b/exe.ld
@@ -101,37 +101,31 @@ SECTIONS
/* Special DT tags used by elf2exe */
/* Final file size */
- LONG(0x6bb31700);
+ LONG(0x6bb31701);
LONG(___.filesize);
/* Final memory size */
- LONG(0x6bb31701);
- LONG(___.end); /* Final memory size */
-
- /* Seg:off form of entry point */
LONG(0x6bb31702);
- SHORT(___start - "___start!");
- SHORT("___start!" >> 4);
+ LONG(___.end); /* Final memory size */
- /* Seg:off form of the initial stack pointer */
+ /* Segment base of entry point (used to compute CS) */
LONG(0x6bb31703);
- SHORT(___stack_end - "___stack_end!");
- SHORT("___stack_end!" >> 4);
+ LONG("___start!");
- /*
- * Base of the stack (usable as temp storage
- * as it does not need to be zeroed.)
- */
+ /* Segment base of the stack (used to compute SS) */
LONG(0x6bb31704);
- LONG(___stack_start);
+ LONG("___stack_end!");
/*
- * Segment base of the stack
+ * Base of the stack, used to compute SP, and usable
+ * as early temp storage as it does not need to be
+ * zeroed, unlike BSS.
*/
- LONG("___stack_end!");
+ LONG(0x6bb31705);
+ LONG(___stack_start);
/* Size of the stack */
- LONG(0x6bb31705);
+ LONG(0x6bb31706);
LONG(___stack_size);
KEEP(*(.dynamic))