From 40a633d5cadf818182a0369e236f58b3c2ed60ae Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 3 Nov 2000 19:49:05 +0000 Subject: [PATCH] Use ${CONSTRUCTING...} to enclose constructors and destructors. --- ld/ChangeLog | 15 +++++++ ld/scripttempl/h8300.sc | 90 ++++++++++++++++++++++--------------- ld/scripttempl/h8300h.sc | 95 ++++++++++++++++++++++++---------------- ld/scripttempl/h8300s.sc | 95 ++++++++++++++++++++++++---------------- ld/scripttempl/h8500.sc | 59 +++++++++++++------------ ld/scripttempl/h8500b.sc | 18 +++++--- ld/scripttempl/h8500c.sc | 21 +++++---- ld/scripttempl/h8500m.sc | 54 ++++++++++++----------- ld/scripttempl/h8500s.sc | 57 +++++++++++++----------- ld/scripttempl/v850.sc | 66 +++++++++++++++++----------- ld/scripttempl/w65.sc | 65 +++++++++++++++------------ ld/scripttempl/z8000.sc | 45 ++++++++++--------- 12 files changed, 400 insertions(+), 280 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 6d3978a2de9..d2e2c9a8387 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,18 @@ +2000-11-03 Nick Clifton + + * 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 * Makefile.in (e_i386_chaos.c): New rule. diff --git a/ld/scripttempl/h8300.sc b/ld/scripttempl/h8300.sc index f2f876e2835..6f4cdcec4b6 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 < 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 d1cfd860b65..e543df924ec 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 < 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 45474fc51ce..b8a3ea53b52 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 < 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 d6a39eec38c..f6e88c61dfc 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 < 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 040a4a7c637..06ce2af6b46 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 < 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 2b87930100e..646c88080a9 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 -- 2.30.2