2.41 Release sources
[binutils-gdb.git] / ld / scripttempl / sh.sc
blob891ef4de6e9dc6825ca7193f46110d862b617ebb
1 # Copyright (C) 2014-2023 Free Software Foundation, Inc.
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.
7 TORS=".tors :
8   {
9     ___ctors = . ;
10     *(.ctors)
11     ___ctors_end = . ;
12     ___dtors = . ;
13     *(.dtors)
14     ___dtors_end = . ;
15   }${RELOCATING+ > ram}"
17 cat <<EOF
18 /* Copyright (C) 2014-2023 Free Software Foundation, Inc.
20    Copying and distribution of this script, with or without modification,
21    are permitted in any medium without royalty provided the copyright
22    notice and this notice are preserved.  */
24 OUTPUT_FORMAT("${OUTPUT_FORMAT}")
25 OUTPUT_ARCH(${ARCH})
27 EOF
29 test -n "${RELOCATING}" && cat <<EOF
30 MEMORY
32   ram : o = 0x1000, l = 512k
35 EOF
37 cat <<EOF
38 SECTIONS
40   .text :
41   {
42     *(.text)
43     *(.strings)
44     ${RELOCATING+ _etext = . ; }
45   } ${RELOCATING+ > ram}
46   ${CONSTRUCTING+${TORS}}
47   .data :
48   {
49     *(.data)
50     ${RELOCATING+*(.gcc_exc*)}
51     ${RELOCATING+___EH_FRAME_BEGIN__ = . ;}
52     ${RELOCATING+*(.eh_fram*)}
53     ${RELOCATING+___EH_FRAME_END__ = . ;}
54     ${RELOCATING+LONG(0);}
55     ${RELOCATING+ _edata = . ; }
56   } ${RELOCATING+ > ram}
57   .bss :
58   {
59     ${RELOCATING+ _bss_start = . ; }
60     *(.bss)
61     *(COMMON)
62     ${RELOCATING+ _end = . ;  }
63   } ${RELOCATING+ > ram}
64   .stack ${RELOCATING+ 0x30000 }  :
65   {
66     ${RELOCATING+ _stack = . ; }
67     *(.stack)
68   } ${RELOCATING+ > ram}
69   .stab 0 ${RELOCATING+(NOLOAD)} :
70   {
71     *(.stab)
72   }
73   .stabstr 0 ${RELOCATING+(NOLOAD)} :
74   {
75     *(.stabstr)
76   }
78 EOF