xref: /netbsd-src/external/gpl3/binutils.old/dist/ld/scripttempl/sh.sc (revision e6c7e151de239c49d2e38720a061ed9d1fa99309)
1# Copyright (C) 2014-2016 Free Software Foundation, Inc.
2#
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.
6
7TORS=".tors :
8  {
9    ___ctors = . ;
10    *(.ctors)
11    ___ctors_end = . ;
12    ___dtors = . ;
13    *(.dtors)
14    ___dtors_end = . ;
15  }"
16
17
18cat <<EOF
19/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
20
21   Copying and distribution of this script, with or without modification,
22   are permitted in any medium without royalty provided the copyright
23   notice and this notice are preserved.  */
24
25OUTPUT_FORMAT("${OUTPUT_FORMAT}")
26OUTPUT_ARCH(${ARCH})
27${LIB_SEARCH_DIRS}
28
29SECTIONS
30{
31  .text :
32  {
33    *(.text)
34    *(.strings)
35    ${RELOCATING+ _etext = . ; }
36  }
37  ${CONSTRUCTING+${TORS}}
38  .data  ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} :
39  {
40    *(.data)
41    ${RELOCATING+*(.gcc_exc*)}
42    ${RELOCATING+___EH_FRAME_BEGIN__ = . ;}
43    ${RELOCATING+*(.eh_fram*)}
44    ${RELOCATING+___EH_FRAME_END__ = . ;}
45    ${RELOCATING+LONG(0);}
46    ${RELOCATING+ _edata = . ; }
47  }
48  .bss ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} :
49  {
50    ${RELOCATING+ _bss_start = . ; }
51    *(.bss)
52    *(COMMON)
53    ${RELOCATING+ _end = . ;  }
54  }
55  .stack :
56  {
57    ${RELOCATING+ _stack = . ; }
58    *(.stack)
59  }
60  .stab 0 ${RELOCATING+(NOLOAD)} :
61  {
62    *(.stab)
63  }
64  .stabstr 0 ${RELOCATING+(NOLOAD)} :
65  {
66    *(.stabstr)
67  }
68}
69EOF
70
71
72
73
74