summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/ld/scripttempl
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/binutils/ld/scripttempl')
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elf32msp430.sc25
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc24
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc25
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/h8300sx.sc97
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/h8300sxn.sc87
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/i860coff.sc42
-rw-r--r--gnu/usr.bin/binutils/ld/scripttempl/mmo.sc2
7 files changed, 270 insertions, 32 deletions
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elf32msp430.sc b/gnu/usr.bin/binutils/ld/scripttempl/elf32msp430.sc
index c3e78d32e6a..5754d662dcf 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elf32msp430.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elf32msp430.sc
@@ -1,3 +1,23 @@
+#!/bin/sh
+
+HEAP_SECTION_MSP430=" "
+HEAP_MEMORY_MSP430=" "
+
+if test ${GOT_HEAP_MSP-0} -ne 0
+then
+HEAP_SECTION_MSP430=".heap ${RELOCATING-0} :
+ {
+ ${RELOCATING+ PROVIDE (__heap_data_start = .) ; }
+ *(.heap*)
+ ${RELOCATING+ PROVIDE (_heap_data_end = .) ; }
+ ${RELOCATING+. = ALIGN(2);}
+ ${RELOCATING+ PROVIDE (__heap_bottom = .) ; }
+ ${RELOCATING+ PROVIDE (__heap_top = ${HEAP_START} + ${HEAP_LENGTH}) ; }
+ } ${RELOCATING+ > heap}"
+HEAP_MEMORY_MSP430="heap(rwx) : ORIGIN = $HEAP_START, LENGTH = $HEAP_LENGTH"
+fi
+
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
@@ -10,6 +30,7 @@ MEMORY
bootloader(rx) : ORIGIN = 0x0c00, LENGTH = 1K
infomem(rx) : ORIGIN = 0x1000, LENGTH = 256
infomemnobits(rx) : ORIGIN = 0x1000, LENGTH = 256
+ ${HEAP_MEMORY_MSP430}
}
SECTIONS
@@ -115,7 +136,7 @@ SECTIONS
*(.fini0) /* Infinite loop after program termination. */
*(.fini)
- ${RELOCATING+ _etext = . ; }
+ _etext = .;
} ${RELOCATING+ > text}
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
@@ -179,6 +200,7 @@ SECTIONS
${RELOCATING+ _vectors_end = . ; }
} ${RELOCATING+ > vectors}
+ ${HEAP_SECTION_MSP430}
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
@@ -219,5 +241,6 @@ SECTIONS
PROVIDE (__data_end_rom = _etext + SIZEOF (.data)) ;
PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
+ PROVIDE (__subdevice_has_heap = ${GOT_HEAP_MSP-0}) ;
}
EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc
index 0883b971b69..f4977f67ac4 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc11.sc
@@ -28,15 +28,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); }
${CONSTRUCTING+${CTOR_START}}
- *(.ctors)
- /* We don't want to include the .ctor section from
- from the crtend.o file until after the sorted ctors.
- The .ctor section from the crtend file contains the
- end of ctors marker and it must be last
-
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors)) */
+ KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}}
${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); }
@@ -45,12 +37,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
DTOR=" .dtors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); }
- *(.dtors)
- /*
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors)) */
+ KEEP (*(.dtors))
${CONSTRUCTING+ PROVIDE(__DTOR_END__ = .); }
} ${RELOCATING+ > ${TEXT_MEMORY}}"
@@ -326,6 +313,8 @@ SECTIONS
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
${RELOCATING+*(.gnu.linkonce.t.*)}
+ ${RELOCATING+*(.tramp)}
+ ${RELOCATING+*(.tramp.*)}
${RELOCATING+${FINISH_CODE}}
@@ -339,6 +328,11 @@ SECTIONS
KEEP (*(.eh_frame))
} ${RELOCATING+ > ${TEXT_MEMORY}}
+ .gcc_except_table ${RELOCATING-0} :
+ {
+ *(.gcc_except_table)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
.rodata ${RELOCATING-0} :
{
*(.rodata)
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc b/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc
index d9a41fd7434..2fa7186c26f 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/elfm68hc12.sc
@@ -28,15 +28,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); }
${CONSTRUCTING+${CTOR_START}}
- *(.ctors)
- /* We don't want to include the .ctor section from
- from the crtend.o file until after the sorted ctors.
- The .ctor section from the crtend file contains the
- end of ctors marker and it must be last
-
- KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
- KEEP (*(SORT(.ctors.*)))
- KEEP (*(.ctors)) */
+ KEEP (*(.ctors))
${CONSTRUCTING+${CTOR_END}}
${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); }
@@ -45,12 +37,7 @@ CTOR=".ctors ${CONSTRUCTING-0} :
DTOR=" .dtors ${CONSTRUCTING-0} :
{
${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); }
- *(.dtors)
- /*
- KEEP (*crtbegin.o(.dtors))
- KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
- KEEP (*(SORT(.dtors.*)))
- KEEP (*(.dtors)) */
+ KEEP (*(.dtors))
${CONSTRUCTING+ PROVIDE(__DTOR_END__ = .); }
} ${RELOCATING+ > ${TEXT_MEMORY}}"
@@ -100,6 +87,7 @@ MEMORY
page0 (rwx) : ORIGIN = 0x0, LENGTH = 256
text (rx) : ORIGIN = ${ROM_START_ADDR}, LENGTH = ${ROM_SIZE}
data : ORIGIN = ${RAM_START_ADDR}, LENGTH = ${RAM_SIZE}
+ eeprom : ORIGIN = ${EEPROM_START_ADDR}, LENGTH = ${EEPROM_SIZE}
}
/* Setup the stack on the top of the data memory bank. */
@@ -324,6 +312,8 @@ SECTIONS
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
${RELOCATING+*(.gnu.linkonce.t.*)}
+ ${RELOCATING+*(.tramp)}
+ ${RELOCATING+*(.tramp.*)}
${RELOCATING+${FINISH_CODE}}
@@ -337,6 +327,11 @@ SECTIONS
KEEP (*(.eh_frame))
} ${RELOCATING+ > ${TEXT_MEMORY}}
+ .gcc_except_table ${RELOCATING-0} :
+ {
+ *(.gcc_except_table)
+ } ${RELOCATING+ > ${TEXT_MEMORY}}
+
.rodata ${RELOCATING-0} :
{
*(.rodata)
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/h8300sx.sc b/gnu/usr.bin/binutils/ld/scripttempl/h8300sx.sc
new file mode 100644
index 00000000000..d3807c0d0cd
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/h8300sx.sc
@@ -0,0 +1,97 @@
+TORS=".tors :
+ {
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;
+ } > ram"
+
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(h8300sx)
+ENTRY("_start")
+
+/* The memory size is 256KB to coincide with the simulator.
+ Don't change either without considering the other. */
+
+MEMORY
+{
+ /* 0xc4 is a magic entry. We should have the linker just
+ skip over it one day... */
+ vectors : o = 0x0000, l = 0xc4
+ magicvectors : o = 0xc4, l = 0x3c
+ /* We still only use 256k as the main ram size. */
+ ram : o = 0x0100, l = 0x3fefc
+ /* The stack starts at the top of main ram. */
+ topram : o = 0x3fffc, l = 0x4
+ /* This holds variables in the "tiny" sections. */
+ tiny : o = 0xff8000, l = 0x7f00
+ /* At the very top of the address space is the 8-bit area. */
+ eight : o = 0xffff00, l = 0x100
+}
+
+SECTIONS
+{
+.vectors :
+ {
+ /* Use something like this to place a specific
+ function's address into the vector table.
+
+ LONG (ABSOLUTE (_foobar)). */
+
+ *(.vectors)
+ } ${RELOCATING+ > vectors}
+
+.text :
+ {
+ *(.rodata)
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
+ } ${RELOCATING+ > ram}
+
+${CONSTRUCTING+${TORS}}
+
+.data :
+ {
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
+ } ${RELOCATING+ > ram}
+
+.bss :
+ {
+ ${RELOCATING+ _bss_start = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
+ } ${RELOCATING+ >ram}
+
+.stack :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
+ } ${RELOCATING+ > topram}
+
+.tiny :
+ {
+ *(.tiny)
+ } ${RELOCATING+ > tiny}
+
+.eight :
+ {
+ *(.eight)
+ } ${RELOCATING+ > eight}
+
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/h8300sxn.sc b/gnu/usr.bin/binutils/ld/scripttempl/h8300sxn.sc
new file mode 100644
index 00000000000..0b1bcf1196f
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/h8300sxn.sc
@@ -0,0 +1,87 @@
+TORS=".tors :
+ {
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;
+ } > ram"
+
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(h8300sxn)
+ENTRY("_start")
+
+MEMORY
+{
+ /* 0xc4 is a magic entry. We should have the linker just
+ skip over it one day... */
+ vectors : o = 0x0000, l = 0xc4
+ magicvectors : o = 0xc4, l = 0x3c
+ ram : o = 0x0100, l = 0xfdfc
+ /* The stack starts at the top of main ram. */
+ topram : o = 0xfefc, l = 0x4
+ /* At the very top of the address space is the 8-bit area. */
+ eight : o = 0xff00, l = 0x100
+}
+
+SECTIONS
+{
+.vectors :
+ {
+ /* Use something like this to place a specific
+ function's address into the vector table.
+
+ SHORT (ABSOLUTE (_foobar)). */
+
+ *(.vectors)
+ } ${RELOCATING+ > vectors}
+
+.text :
+ {
+ *(.rodata)
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
+ } ${RELOCATING+ > ram}
+
+${CONSTRUCTING+${TORS}}
+
+.data :
+ {
+ *(.data)
+ *(.tiny)
+ ${RELOCATING+ _edata = . ; }
+ } ${RELOCATING+ > ram}
+
+.bss :
+ {
+ ${RELOCATING+ _bss_start = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
+ } ${RELOCATING+ >ram}
+
+.stack :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
+ } ${RELOCATING+ > topram}
+
+.eight :
+ {
+ *(.eight)
+ } ${RELOCATING+ > eight}
+
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/i860coff.sc b/gnu/usr.bin/binutils/ld/scripttempl/i860coff.sc
new file mode 100644
index 00000000000..f268c6f9060
--- /dev/null
+++ b/gnu/usr.bin/binutils/ld/scripttempl/i860coff.sc
@@ -0,0 +1,42 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+${LIB_SEARCH_DIRS}
+PROVIDE (__stack = 0);
+SECTIONS
+{
+ .text ${RELOCATING+ 0x1000000} : {
+ *(.text)
+ ${CONSTRUCTING+ . = ALIGN(4);}
+ ${RELOCATING+ etext = .;}
+ ${CONSTRUCTING+ __CTOR_LIST__ = .;}
+ ${CONSTRUCTING+ LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)}
+ ${CONSTRUCTING+ *(.ctors)}
+ ${CONSTRUCTING+ LONG(0)}
+ ${CONSTRUCTING+ __CTOR_END__ = .;}
+ ${CONSTRUCTING+ __DTOR_LIST__ = .;}
+ ${CONSTRUCTING+ LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)}
+ ${CONSTRUCTING+ *(.dtors)}
+ ${CONSTRUCTING+ LONG(0)}
+ ${CONSTRUCTING+ __DTOR_END__ = .;}
+ }
+ .data : {
+ *(.data)
+ ${RELOCATING+ edata = .};
+ }
+ .bss : {
+ ${RELOCATING+ __bss_start = .};
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ end = ALIGN(0x8)};
+ ${RELOCATING+ _end = ALIGN(0x8)};
+ }
+ .stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+ .stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
+}
+EOF
diff --git a/gnu/usr.bin/binutils/ld/scripttempl/mmo.sc b/gnu/usr.bin/binutils/ld/scripttempl/mmo.sc
index b93953db53a..643b349539e 100644
--- a/gnu/usr.bin/binutils/ld/scripttempl/mmo.sc
+++ b/gnu/usr.bin/binutils/ld/scripttempl/mmo.sc
@@ -55,7 +55,7 @@ SECTIONS
${RELOCATING+ PROVIDE(_etext = .);}
${RELOCATING+ PROVIDE(__etext = .);}
}
- ${RELOCATING+Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : . - SIZEOF (.text));}
+ ${RELOCATING+Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : ADDR (.text));}
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }