aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-11-03 19:49:05 +0000
committerNick Clifton <nickc@redhat.com>2000-11-03 19:49:05 +0000
commit40a633d5cadf818182a0369e236f58b3c2ed60ae (patch)
tree2ca0a36ea4abc8343d013c41cebe0594921a9ede /ld
parent36b0c0e0219069b331db088e9cf7f5b2797e9293 (diff)
downloadgdb-40a633d5cadf818182a0369e236f58b3c2ed60ae.zip
gdb-40a633d5cadf818182a0369e236f58b3c2ed60ae.tar.gz
gdb-40a633d5cadf818182a0369e236f58b3c2ed60ae.tar.bz2
Use ${CONSTRUCTING...} to enclose constructors and destructors.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog15
-rw-r--r--ld/scripttempl/h8300.sc90
-rw-r--r--ld/scripttempl/h8300h.sc95
-rw-r--r--ld/scripttempl/h8300s.sc95
-rw-r--r--ld/scripttempl/h8500.sc59
-rw-r--r--ld/scripttempl/h8500b.sc18
-rw-r--r--ld/scripttempl/h8500c.sc21
-rw-r--r--ld/scripttempl/h8500m.sc54
-rw-r--r--ld/scripttempl/h8500s.sc57
-rw-r--r--ld/scripttempl/v850.sc66
-rw-r--r--ld/scripttempl/w65.sc65
-rw-r--r--ld/scripttempl/z8000.sc45
12 files changed, 400 insertions, 280 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 6d3978a..d2e2c9a 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,18 @@
+2000-11-03 Nick Clifton <nickc@redhat.com>
+
+ * scripttempl/h8300.sc: Use ${CONSTRUCTING...} to enclose
+ constructors and destructors.
+ * scripttempl/h8300h.sc: Ditto.
+ * scripttempl/h8300s.sc: Ditto.
+ * scripttempl/h8500.sc: Ditto.
+ * scripttempl/h8500b.sc: Ditto.
+ * scripttempl/h8500c.sc: Ditto.
+ * scripttempl/h8500m.sc: Ditto.
+ * scripttempl/h8500s.sc: Ditto.
+ * scripttempl/v850.sc: Ditto.
+ * scripttempl/w65.sc: Ditto.
+ * scripttempl/z8000.sc: Ditto.
+
2000-11-02 Per Lundberg <plundis@chaosdev.org>
* Makefile.in (e_i386_chaos.c): New rule.
diff --git a/ld/scripttempl/h8300.sc b/ld/scripttempl/h8300.sc
index f2f876e..6f4cdce 100644
--- a/ld/scripttempl/h8300.sc
+++ b/ld/scripttempl/h8300.sc
@@ -1,3 +1,13 @@
+TORS=".tors :
+ {
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;
+ } > ram"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
@@ -18,52 +28,60 @@ MEMORY
SECTIONS
{
-.vectors : {
- /* Use something like this to place a specific function's address
- into the vector table.
+.vectors :
+ {
+ /* Use something like this to place a specific
+ function's address into the vector table.
- SHORT(ABSOLUTE(_foobar)) */
+ SHORT (ABSOLUTE (_foobar)). */
- *(.vectors)
+ *(.vectors)
} ${RELOCATING+ > vectors}
-.text : {
- *(.rodata)
- *(.text)
- *(.strings)
- ${RELOCATING+ _etext = . ; }
- } ${RELOCATING+ > ram}
-.tors : {
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
+.text :
+ {
+ *(.rodata)
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > ram}
-.data : {
- *(.data)
- *(.tiny)
- ${RELOCATING+ _edata = . ; }
+
+ ${CONSTRUCTING+${TORS}}
+
+.data :
+ {
+ *(.data)
+ *(.tiny)
+ ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ram}
-.bss : {
- ${RELOCATING+ _bss_start = . ;}
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
+
+.bss :
+ {
+ ${RELOCATING+ _bss_start = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
} ${RELOCATING+ >ram}
-.stack : {
- ${RELOCATING+ _stack = . ; }
- *(.stack)
+
+.stack :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
} ${RELOCATING+ > topram}
-.eight : {
- *(.eight)
+
+.eight :
+ {
+ *(.eight)
} ${RELOCATING+ > eight}
-.stab 0 ${RELOCATING+(NOLOAD)} : {
- [ .stab ]
+
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
}
-.stabstr 0 ${RELOCATING+(NOLOAD)} : {
- [ .stabstr ]
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
}
}
EOF
diff --git a/ld/scripttempl/h8300h.sc b/ld/scripttempl/h8300h.sc
index d1cfd86..e543df9 100644
--- a/ld/scripttempl/h8300h.sc
+++ b/ld/scripttempl/h8300h.sc
@@ -1,3 +1,13 @@
+TORS=".tors :
+ {
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;
+ } > ram"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(h8300h)
@@ -24,53 +34,64 @@ MEMORY
SECTIONS
{
-.vectors : {
- /* Use something like this to place a specific function's address
- into the vector table.
+.vectors :
+ {
+ /* Use something like this to place a specific
+ function's address into the vector table.
- LONG(ABSOLUTE(_foobar)) */
+ LONG (ABSOLUTE (_foobar)). */
- *(.vectors)
+ *(.vectors)
} ${RELOCATING+ > vectors}
-.text : {
- *(.rodata)
- *(.text)
- *(.strings)
- ${RELOCATING+ _etext = . ; }
- } ${RELOCATING+ > ram}
-.tors : {
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
+
+.text :
+ {
+ *(.rodata)
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > ram}
-.data : {
- *(.data)
- ${RELOCATING+ _edata = . ; }
+
+ ${CONSTRUCTING+${TORS}}
+
+.data :
+ {
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ram}
-.bss : {
- ${RELOCATING+ _bss_start = . ;}
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
+
+.bss :
+ {
+ ${RELOCATING+ _bss_start = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
} ${RELOCATING+ >ram}
-.stack : {
- ${RELOCATING+ _stack = . ; }
- *(.stack)
+
+.stack :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
} ${RELOCATING+ > topram}
-.tiny : {
- *(.tiny)
+
+.tiny :
+ {
+ *(.tiny)
} ${RELOCATING+ > tiny}
-.eight : {
- *(.eight)
+
+.eight :
+ {
+ *(.eight)
} ${RELOCATING+ > eight}
-.stab 0 ${RELOCATING+(NOLOAD)} : {
- [ .stab ]
+
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
}
-.stabstr 0 ${RELOCATING+(NOLOAD)} : {
- [ .stabstr ]
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
}
}
EOF
diff --git a/ld/scripttempl/h8300s.sc b/ld/scripttempl/h8300s.sc
index 45474fc..b8a3ea5 100644
--- a/ld/scripttempl/h8300s.sc
+++ b/ld/scripttempl/h8300s.sc
@@ -1,3 +1,13 @@
+TORS=".tors :
+ {
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;
+ } > ram"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(h8300s)
@@ -24,53 +34,64 @@ MEMORY
SECTIONS
{
-.vectors : {
- /* Use something like this to place a specific function's address
- into the vector table.
+.vectors :
+ {
+ /* Use something like this to place a specific function's address
+ into the vector table.
- LONG(ABSOLUTE(_foobar)) */
+ LONG (ABSOLUTE (_foobar)). */
- *(.vectors)
+ *(.vectors)
} ${RELOCATING+ > vectors}
-.text : {
- *(.rodata)
- *(.text)
- *(.strings)
- ${RELOCATING+ _etext = . ; }
- } ${RELOCATING+ > ram}
-.tors : {
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
+
+.text :
+ {
+ *(.rodata)
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > ram}
-.data : {
- *(.data)
- ${RELOCATING+ _edata = . ; }
+
+ ${CONSTRUCTING+${TORS}}
+
+.data :
+ {
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ram}
-.bss : {
- ${RELOCATING+ _bss_start = . ;}
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
+
+.bss :
+ {
+ ${RELOCATING+ _bss_start = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
} ${RELOCATING+ >ram}
-.stack : {
- ${RELOCATING+ _stack = . ; }
- *(.stack)
+
+.stack :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
} ${RELOCATING+ > topram}
-.tiny : {
- *(.tiny)
+
+.tiny :
+ {
+ *(.tiny)
} ${RELOCATING+ > tiny}
-.eight : {
- *(.eight)
+
+.eight :
+ {
+ *(.eight)
} ${RELOCATING+ > eight}
-.stab 0 ${RELOCATING+(NOLOAD)} : {
- [ .stab ]
+
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
}
-.stabstr 0 ${RELOCATING+(NOLOAD)} : {
- [ .stabstr ]
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
}
}
EOF
diff --git a/ld/scripttempl/h8500.sc b/ld/scripttempl/h8500.sc
index d6a39ee..f6e88c6 100644
--- a/ld/scripttempl/h8500.sc
+++ b/ld/scripttempl/h8500.sc
@@ -1,3 +1,11 @@
+TORS="
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
@@ -8,52 +16,47 @@ SECTIONS
{
.text ${RELOCATING+ 0x0000 } :
{
- *(.text)
-
- ${RELOCATING+ _etext = . ; }
+ *(.text)
+ ${RELOCATING+ _etext = . ; }
}
-
.data ${RELOCATING+ . } :
{
- *(.data)
- ${RELOCATING+ _edata = . ; }
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
}
.rdata ${RELOCATING+ . } :
{
- *(.rdata);
+ *(.rdata);
*(.strings)
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
-}
+
+ ${CONSTRUCTING+${TORS}}
+ }
.bss ${RELOCATING+ . } :
{
- ${RELOCATING+ __start_bss = . ; }
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
+ ${RELOCATING+ __start_bss = . ; }
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
}
.stack ${RELOCATING+ 0xfff0} :
{
- ${RELOCATING+ _stack = . ; }
- *(.stack)
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
}
- .stab 0 ${RELOCATING+(NOLOAD)} :
- {
- [ .stab ]
- }
- .stabstr 0 ${RELOCATING+(NOLOAD)} :
- {
- [ .stabstr ]
- }
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
}
EOF
diff --git a/ld/scripttempl/h8500b.sc b/ld/scripttempl/h8500b.sc
index ef5fa2c..a64eebc 100644
--- a/ld/scripttempl/h8500b.sc
+++ b/ld/scripttempl/h8500b.sc
@@ -1,3 +1,11 @@
+TORS="
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
@@ -24,13 +32,9 @@ SECTIONS
{
*(.rdata);
*(.strings)
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
-}
+
+ ${CONSTRUCTING+${TORS}}
+ }
.bss ${RELOCATING+ 0x40000} :
{
diff --git a/ld/scripttempl/h8500c.sc b/ld/scripttempl/h8500c.sc
index 03880e3..bc69649 100644
--- a/ld/scripttempl/h8500c.sc
+++ b/ld/scripttempl/h8500c.sc
@@ -1,3 +1,11 @@
+TORS="
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
@@ -20,15 +28,12 @@ SECTIONS
${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ram}
-.rdata 0x30000 : {
+.rdata 0x30000 :
+ {
*(.rdata);
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
-} ${RELOCATING+ > ram}
+
+ ${CONSTRUCTING+${TORS}}
+ } ${RELOCATING+ > ram}
.bss 0x40000 :
{
diff --git a/ld/scripttempl/h8500m.sc b/ld/scripttempl/h8500m.sc
index 040a4a7..06ce2af 100644
--- a/ld/scripttempl/h8500m.sc
+++ b/ld/scripttempl/h8500m.sc
@@ -1,3 +1,11 @@
+TORS="
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
@@ -9,50 +17,46 @@ SECTIONS
.text ${RELOCATING+ 0x10000} :
{
*(.text)
- ${RELOCATING+ _etext = . ; }
+ ${RELOCATING+ _etext = . ; }
}
-
.data ${RELOCATING+ 0x20000} :
{
- *(.data)
- ${RELOCATING+ _edata = . ; }
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
}
.rdata ${RELOCATING+ . } :
{
- *(.rdata);
+ *(.rdata);
*(.strings)
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
+
+ ${CONSTRUCTING+${TORS}}
}
.bss ${RELOCATING+ . } :
{
- ${RELOCATING+ __start_bss = . ; }
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
+ ${RELOCATING+ __start_bss = . ; }
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
}
.stack ${RELOCATING+ 0x2fff0} :
{
- ${RELOCATING+ _stack = . ; }
- *(.stack)
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
}
- .stab 0 ${RELOCATING+(NOLOAD)} :
- {
- [ .stab ]
- }
- .stabstr 0 ${RELOCATING+(NOLOAD)} :
- {
- [ .stabstr ]
- }
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
}
EOF
diff --git a/ld/scripttempl/h8500s.sc b/ld/scripttempl/h8500s.sc
index 11615d8..2567489 100644
--- a/ld/scripttempl/h8500s.sc
+++ b/ld/scripttempl/h8500s.sc
@@ -1,3 +1,11 @@
+TORS="
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
@@ -8,50 +16,47 @@ SECTIONS
{
.text ${RELOCATING+ 0x10000 } :
{
- *(.text)
- ${RELOCATING+ _etext = . ; }
+ *(.text)
+ ${RELOCATING+ _etext = . ; }
}
.rdata ${RELOCATING+ 0x20000 } :
{
- *(.rdata);
- *(.strings)
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
+ *(.rdata);
+ *(.strings)
+
+ ${CONSTRUCTING+${TORS}}
}
.data ${RELOCATING+ . } :
{
- *(.data)
- ${RELOCATING+ _edata = . ; }
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
}
.bss ${RELOCATING+ .} :
{
- ${RELOCATING+ __start_bss = . ; }
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
+ ${RELOCATING+ __start_bss = . ; }
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
}
.stack ${RELOCATING+ 0x2fff0} :
{
- ${RELOCATING+ _stack = . ; }
- *(.stack)
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
}
- .stab 0 ${RELOCATING+(NOLOAD)} :
- {
- [ .stab ]
- }
- .stabstr 0 ${RELOCATING+(NOLOAD)} :
- {
- [ .stabstr ]
- }
+.stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+
+.stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
}
EOF
diff --git a/ld/scripttempl/v850.sc b/ld/scripttempl/v850.sc
index 5c5f9ea..90731de 100644
--- a/ld/scripttempl/v850.sc
+++ b/ld/scripttempl/v850.sc
@@ -4,13 +4,13 @@ OUTPUT_FORMAT("elf32-v850", "elf32-v850",
OUTPUT_ARCH(v850)
ENTRY(_start)
SEARCH_DIR(.);
-/*/critters/slug/grossman/install/sun4/v850-elf/lib*/
SECTIONS
{
/* This saves a little space in the ELF file, since the zda starts
at a higher location that the ELF headers take up. */
- .zdata ${ZDATA_START_ADDR} : {
+ .zdata ${ZDATA_START_ADDR} :
+ {
*(.zdata)
*(.zbss)
*(reszdata)
@@ -23,13 +23,14 @@ SECTIONS
section. Specifically it prevents the zdata
section from being marked READONLY. */
- .rozdata ${ROZDATA_START_ADDR} : {
+ .rozdata ${ROZDATA_START_ADDR} :
+ {
*(.rozdata)
*(romzdata)
*(romzbss)
}
- /* Read-only sections, merged into text segment: */
+ /* Read-only sections, merged into text segment. */
. = ${TEXT_START_ADDR};
.interp : { *(.interp) }
.hash : { *(.hash) }
@@ -58,9 +59,11 @@ SECTIONS
.init : { KEEP (*(.init)) } =0
.plt : { *(.plt) }
- .text : {
+ .text :
+ {
*(.text)
${RELOCATING+*(.text.*)}
+
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
@@ -73,45 +76,51 @@ SECTIONS
It contains a small lookup table at the start followed by the
code pointed to by entries in the lookup table. */
- .call_table_data ${CALL_TABLE_START_ADDR} : {
+ .call_table_data ${CALL_TABLE_START_ADDR} :
+ {
${RELOCATING+PROVIDE(__ctbp = .);}
*(.call_table_data)
- } = 0xff /* fill gaps with 0xff */
- .call_table_text : {
+ } = 0xff /* Fill gaps with 0xff. */
+
+ .call_table_text :
+ {
*(.call_table_text)
}
- .fini : { KEEP (*(.fini)) } =0
+ .fini : { KEEP (*(.fini)) } =0
.rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) }
.rodata1 : { *(.rodata1) }
- .data : {
+ .data :
+ {
*(.data)
${RELOCATING+*(.data.*)}
*(.gnu.linkonce.d*)
CONSTRUCTORS
}
.data1 : { *(.data1) }
- .ctors : {
- ${RELOCATING+___ctors = .;}
+ .ctors :
+ {
+ ${CONSTRUCTING+___ctors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend(.ctors))
- ${RELOCATING+___ctors_end = .;}
+ ${CONSTRUCTING+___ctors_end = .;}
}
-
- .dtors : {
- ${RELOCATING+___dtors = .;}
+ .dtors :
+ {
+ ${CONSTRUCTING+___dtors = .;}
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors))
- ${RELOCATING+___dtors_end = .;}
+ ${CONSTRUCTING+___dtors_end = .;}
}
.got : { *(.got.plt) *(.got) }
.dynamic : { *(.dynamic) }
- .tdata ${TDATA_START_ADDR} : {
+ .tdata ${TDATA_START_ADDR} :
+ {
${RELOCATING+PROVIDE (__ep = .);}
*(.tbyte)
*(.tcommon_byte)
@@ -123,21 +132,26 @@ SECTIONS
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
- .sdata ${SDATA_START_ADDR} : {
+
+ .sdata ${SDATA_START_ADDR} :
+ {
${RELOCATING+PROVIDE (__gp = . + 0x8000);}
*(.sdata)
}
/* See comment about .rozdata. */
- .rosdata ${ROSDATA_START_ADDR} : {
+ .rosdata ${ROSDATA_START_ADDR} :
+ {
*(.rosdata)
}
/* We place the .sbss data section AFTER the .rosdata section, so that
it can directly preceed the .bss section. This allows runtime startup
code to initialise all the zero-data sections by simply taking the
- value of '_edata' and zeroing until it reaches '_end' */
- .sbss : {
+ value of '_edata' and zeroing until it reaches '_end'. */
+
+ .sbss :
+ {
${RELOCATING+__sbss_start = .;}
*(.sbss)
*(.scommon)
@@ -192,17 +206,17 @@ SECTIONS
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
+ /* SGI/MIPS DWARF 2 extensions. */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
- /* User stack */
- .stack 0x200000 : {
+ /* User stack. */
+ .stack 0x200000 :
+ {
${RELOCATING+__stack = .;}
*(.stack)
}
- /* These must appear regardless of . */
}
EOF
diff --git a/ld/scripttempl/w65.sc b/ld/scripttempl/w65.sc
index f904495..f92d999 100644
--- a/ld/scripttempl/w65.sc
+++ b/ld/scripttempl/w65.sc
@@ -1,10 +1,21 @@
+TORS=".tors :
+ {
+ ___ctors = . ;
+ *(.ctors)
+ ___ctors_end = . ;
+ ___dtors = . ;
+ *(.dtors)
+ ___dtors_end = . ;
+ } > ram"
+
cat <<EOF
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
OUTPUT_ARCH(${ARCH})
-MEMORY {
+MEMORY
+{
ram : o = 0x1000, l = 512k
- }
+}
SECTIONS
{
@@ -12,44 +23,40 @@ SECTIONS
{
*(.text)
*(.strings)
- ${RELOCATING+ _etext = . ; }
+ ${RELOCATING+ _etext = . ; }
} ${RELOCATING+ > ram}
-
-.tors : {
- ___ctors = . ;
- *(.ctors)
- ___ctors_end = . ;
- ___dtors = . ;
- *(.dtors)
- ___dtors_end = . ;
-} ${RELOCATING+ > ram}
+ ${CONSTRUCTING+${TORS}}
.data :
{
- *(.data)
- ${RELOCATING+ _edata = . ; }
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
} ${RELOCATING+ > ram}
+
.bss :
{
- ${RELOCATING+ _bss_start = . ; }
- *(.bss)
- *(COMMON)
- ${RELOCATING+ _end = . ; }
+ ${RELOCATING+ _bss_start = . ; }
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
} ${RELOCATING+ >ram}
-.stack ${RELOCATING+ 0x30000 } :
+
+.stack ${RELOCATING+ 0x30000 } :
{
- ${RELOCATING+ _stack = . ; }
- *(.stack)
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
} ${RELOCATING+ > ram}
- .stab . (NOLOAD) :
- {
- [ .stab ]
- }
- .stabstr . (NOLOAD) :
- {
- [ .stabstr ]
- }
+
+.stab . (NOLOAD) :
+ {
+ [ .stab ]
+ }
+
+.stabstr . (NOLOAD) :
+ {
+ [ .stabstr ]
+ }
}
EOF
diff --git a/ld/scripttempl/z8000.sc b/ld/scripttempl/z8000.sc
index 2b87930..646c880 100644
--- a/ld/scripttempl/z8000.sc
+++ b/ld/scripttempl/z8000.sc
@@ -5,7 +5,8 @@ ENTRY(_start)
SECTIONS
{
-.text ${BIG+ ${RELOCATING+ 0x0000000}} : {
+.text ${BIG+ ${RELOCATING+ 0x0000000}} :
+ {
*(.text)
*(.strings)
*(.rdata)
@@ -13,38 +14,40 @@ SECTIONS
.ctors ${BIG+ ${RELOCATING+ 0x2000000}} :
{
- ${RELOCATING+ ___ctors = . ; }
+ ${CONSTRUCTING+ ___ctors = . ; }
*(.ctors);
- ${RELOCATING+ ___ctors_end = . ; }
+ ${CONSTRUCTING+ ___ctors_end = . ; }
___dtors = . ;
*(.dtors);
- ${RELOCATING+ ___dtors_end = . ; }
+ ${CONSTRUCTING+ ___dtors_end = . ; }
}
-.data ${BIG+ ${RELOCATING+ 0x3000000}} : {
- *(.data)
+.data ${BIG+ ${RELOCATING+ 0x3000000}} :
+ {
+ *(.data)
}
.bss ${BIG+ ${RELOCATING+ 0x4000000}} :
- {
- ${RELOCATING+ __start_bss = . ; }
- *(.bss);
- *(COMMON);
- ${RELOCATING+ __end_bss = . ; }
- }
-
-.heap ${BIG+ ${RELOCATING+ 0x5000000}} : {
- ${RELOCATING+ __start_heap = . ; }
- ${RELOCATING+ . = . + 20k ; }
- ${RELOCATING+ __end_heap = . ; }
+ {
+ ${RELOCATING+ __start_bss = . ; }
+ *(.bss);
+ *(COMMON);
+ ${RELOCATING+ __end_bss = . ; }
+ }
+
+.heap ${BIG+ ${RELOCATING+ 0x5000000}} :
+ {
+ ${RELOCATING+ __start_heap = . ; }
+ ${RELOCATING+ . = . + 20k ; }
+ ${RELOCATING+ __end_heap = . ; }
}
.stack ${RELOCATING+ 0xf000 } :
{
- ${RELOCATING+ _stack = . ; }
- *(.stack)
- ${RELOCATING+ __stack_top = . ; }
- }
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
+ ${RELOCATING+ __stack_top = . ; }
+ }
}
EOF