aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/emulparams/crislinux.sh14
-rw-r--r--ld/scripttempl/crisaout.sc72
3 files changed, 51 insertions, 43 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9145e98..5419411 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2000-11-30 Hans-Peter Nilsson <hp@axis.com>
+
+ * emulparams/crislinux.sh (ENTRY): Change back to _start.
+ (TEXT_START_SYMBOLS): Remove conditional setting of __start.
+
+ * scripttempl/crisaout.sc: Change all RELOCATING not related to
+ merging non-a.out sections into CONSTRUCTING.
+
2000-11-28 Nick Clifton <nickc@redhat.com>
* ld.1 (COPYING): Mention that the GNU Free Documentation
diff --git a/ld/emulparams/crislinux.sh b/ld/emulparams/crislinux.sh
index 22ea9ea..6be4f58 100644
--- a/ld/emulparams/crislinux.sh
+++ b/ld/emulparams/crislinux.sh
@@ -4,7 +4,9 @@ SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-cris"
ARCH=cris
TEMPLATE_NAME=elf32
-ENTRY=__start
+
+ENTRY=_start
+
# Needed? Perhaps should be page-size alignment.
ALIGNMENT=32
GENERATE_SHLIB_SCRIPT=yes
@@ -16,12 +18,10 @@ MAXPAGESIZE=8192
# FIXME: GOT, PLT...
-TEXT_START_SYMBOLS='PROVIDE (__Stext = .);
-__start = DEFINED(__start) ? __start :
- DEFINED(_start) ? _start :
- DEFINED(start) ? start :
- DEFINED(.startup) ? .startup + 2 : 2;
-'
+# We don't do the hoops through DEFINED to provide [_]*start, as it
+# doesn't work with --gc-sections, and the start-name is pretty fixed
+# anyway.
+TEXT_START_SYMBOLS='PROVIDE (__Stext = .);'
# Smuggle an "OTHER_TEXT_END_SYMBOLS" here.
OTHER_READONLY_SECTIONS='PROVIDE (__Etext = .);'
diff --git a/ld/scripttempl/crisaout.sc b/ld/scripttempl/crisaout.sc
index e909af3..c729668 100644
--- a/ld/scripttempl/crisaout.sc
+++ b/ld/scripttempl/crisaout.sc
@@ -7,10 +7,10 @@ SECTIONS
.text ${RELOCATING+ ${TEXT_START_ADDR}}:
{
CREATE_OBJECT_SYMBOLS;
- ${RELOCATING+ __Stext = .;}
+ ${CONSTRUCTING+ __Stext = .;}
${RELOCATING+*(.startup)}
*(.text)
- ${RELOCATING+__start = DEFINED(__start) ? __start :
+ ${CONSTRUCTING+__start = DEFINED(__start) ? __start :
DEFINED(_start) ? _start :
DEFINED(start) ? start :
DEFINED(.startup) ? .startup + 2 : 2;}
@@ -25,25 +25,25 @@ SECTIONS
default.
FIXME: It's somewhat unexpected to have code emitted by the linker
script. Some other mechanism could probably do better. */
- ${RELOCATING+. = ALIGN (2);}
- ${RELOCATING+ ___init__start = .;}
- ${RELOCATING+PROVIDE (___do_global_ctors = .);}
- ${RELOCATING+SHORT (0xe1fc); /* push srp */}
- ${RELOCATING+SHORT (0xbe7e);}
- ${RELOCATING+*(.init)}
- ${RELOCATING+SHORT (0x0d3e); /* jump [sp+] */}
- ${RELOCATING+PROVIDE (__init__end = .);}
- ${RELOCATING+PROVIDE (___init__end = .);}
-
- ${RELOCATING+. = ALIGN (2);}
- ${RELOCATING+ ___fini__start = .;}
- ${RELOCATING+PROVIDE (___do_global_dtors = .);}
- ${RELOCATING+SHORT (0xe1fc); /* push srp */}
- ${RELOCATING+SHORT (0xbe7e);}
- ${RELOCATING+*(.fini)}
- ${RELOCATING+SHORT (0x0d3e); /* jump [sp+] */}
- ${RELOCATING+PROVIDE (__fini__end = .);}
- ${RELOCATING+ ___fini__end = .;}
+ ${CONSTRUCTING+ . = ALIGN (2);}
+ ${CONSTRUCTING+ ___init__start = .;}
+ ${CONSTRUCTING+ PROVIDE (___do_global_ctors = .);}
+ ${CONSTRUCTING+ SHORT (0xe1fc); /* push srp */}
+ ${CONSTRUCTING+ SHORT (0xbe7e);}
+ ${CONSTRUCTING+ *(.init)}
+ ${CONSTRUCTING+ SHORT (0x0d3e); /* jump [sp+] */}
+ ${CONSTRUCTING+ PROVIDE (__init__end = .);}
+ ${CONSTRUCTING+ PROVIDE (___init__end = .);}
+
+ ${CONSTRUCTING+ . = ALIGN (2);}
+ ${CONSTRUCTING+ ___fini__start = .;}
+ ${CONSTRUCTING+ PROVIDE (___do_global_dtors = .);}
+ ${CONSTRUCTING+ SHORT (0xe1fc); /* push srp */}
+ ${CONSTRUCTING+ SHORT (0xbe7e);}
+ ${CONSTRUCTING+ *(.fini)}
+ ${CONSTRUCTING+ SHORT (0x0d3e); /* jump [sp+] */}
+ ${CONSTRUCTING+ PROVIDE (__fini__end = .);}
+ ${CONSTRUCTING+ ___fini__end = .;}
/* Cater to linking from ELF. */
${CONSTRUCTING+ PROVIDE(___ctors = .);}
@@ -68,12 +68,12 @@ SECTIONS
of itself in the a.out header. This should only matter for
testing; for production use, .data is at a "known" location.
We assume .data does not get an alignment larger than 32 bytes. */
- ${RELOCATING+. = ALIGN (32);}
+ ${CONSTRUCTING+. = ALIGN (32);}
- ${RELOCATING+ __Etext = .;}
+ ${CONSTRUCTING+ __Etext = .;}
/* Deprecated, use __Etext. */
- ${RELOCATING+ PROVIDE(_etext = .);}
+ ${CONSTRUCTING+ PROVIDE(_etext = .);}
}
/* Any dot-relative start-expression (such as "ALIGN(2)", also including
@@ -84,7 +84,7 @@ SECTIONS
unimportant. */
.data :
{
- ${RELOCATING+ __Sdata = .;}
+ ${CONSTRUCTING+ __Sdata = .;}
*(.data);
${RELOCATING+*(.data.*)}
${RELOCATING+*(.gnu.linkonce.d*)}
@@ -92,30 +92,30 @@ SECTIONS
${RELOCATING+*(.gcc_except_table)}
/* See comment at ALIGN before __Etext. */
- ${RELOCATING+. = ALIGN (32);}
+ ${CONSTRUCTING+. = ALIGN (32);}
- ${RELOCATING+ __Edata = .;}
+ ${CONSTRUCTING+ __Edata = .;}
/* Deprecated, use __Edata. */
- ${RELOCATING+ PROVIDE(_edata = .);}
+ ${CONSTRUCTING+ PROVIDE(_edata = .);}
}
.bss :
{
/* Deprecated, use __Sbss. */
- ${RELOCATING+ PROVIDE(_bss_start = .);}
+ ${CONSTRUCTING+ PROVIDE(_bss_start = .);}
- ${RELOCATING+ __Sbss = .;}
+ ${CONSTRUCTING+ __Sbss = .;}
*(.bss)
${RELOCATING+*(.bss.*)}
*(COMMON)
- ${RELOCATING+ __Ebss = .;}
+ ${CONSTRUCTING+ __Ebss = .;}
/* Deprecated, use __Ebss or __Eall as appropriate. */
- ${RELOCATING+ PROVIDE(_end = .);}
- ${RELOCATING+ PROVIDE(__end = .);}
+ ${CONSTRUCTING+ PROVIDE(_end = .);}
+ ${CONSTRUCTING+ PROVIDE(__end = .);}
}
- ${RELOCATING+ __Eall = .;}
+ ${CONSTRUCTING+ __Eall = .;}
/* Unfortunately, stabs are not mappable from ELF to a.out.
It can probably be fixed with some amount of work. */
@@ -123,9 +123,9 @@ SECTIONS
{ *(.stab) *(.stab*) *(.debug) *(.debug*) *(.comment) *(.gnu.warning.*) }
/* For the rsim and xsim simulators. */
- ${RELOCATING+ PROVIDE(__Endmem = 0x10000000);}
+ ${CONSTRUCTING+ PROVIDE(__Endmem = 0x10000000);}
/* For elinux. */
- ${RELOCATING+ PROVIDE(__Stacksize = 0);}
+ ${CONSTRUCTING+ PROVIDE(__Stacksize = 0);}
}
EOF