1*b88e3e88Schristos# Copyright (C) 2014-2020 Free Software Foundation, Inc.
2440a403fSchristos#
3440a403fSchristos# Copying and distribution of this file, with or without modification,
4440a403fSchristos# are permitted in any medium without royalty provided the copyright
5440a403fSchristos# notice and this notice are preserved.
6440a403fSchristos
7440a403fSchristosTORS=".tors :
8440a403fSchristos  {
9440a403fSchristos    ___ctors = . ;
10440a403fSchristos    *(.ctors)
11440a403fSchristos    ___ctors_end = . ;
12440a403fSchristos    ___dtors = . ;
13440a403fSchristos    *(.dtors)
14440a403fSchristos    ___dtors_end = . ;
15*b88e3e88Schristos  }${RELOCATING+ > ram}"
16440a403fSchristos
17440a403fSchristoscat <<EOF
18*b88e3e88Schristos/* Copyright (C) 2014-2020 Free Software Foundation, Inc.
19440a403fSchristos
20440a403fSchristos   Copying and distribution of this script, with or without modification,
21440a403fSchristos   are permitted in any medium without royalty provided the copyright
22440a403fSchristos   notice and this notice are preserved.  */
23440a403fSchristos
24440a403fSchristosOUTPUT_FORMAT("${OUTPUT_FORMAT}")
25440a403fSchristosOUTPUT_ARCH(${ARCH})
26440a403fSchristos${LIB_SEARCH_DIRS}
27440a403fSchristos
28*b88e3e88SchristosEOF
29*b88e3e88Schristos
30*b88e3e88Schristostest -n "${RELOCATING}" && cat <<EOF
31*b88e3e88SchristosMEMORY
32*b88e3e88Schristos{
33*b88e3e88Schristos  ram : o = 0x1000, l = 512k
34*b88e3e88Schristos}
35*b88e3e88Schristos
36*b88e3e88SchristosEOF
37*b88e3e88Schristos
38*b88e3e88Schristoscat <<EOF
39440a403fSchristosSECTIONS
40440a403fSchristos{
41440a403fSchristos  .text :
42440a403fSchristos  {
43440a403fSchristos    *(.text)
44440a403fSchristos    *(.strings)
45440a403fSchristos    ${RELOCATING+ _etext = . ; }
46440a403fSchristos  }
47440a403fSchristos  ${CONSTRUCTING+${TORS}}
48440a403fSchristos  .data  ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} :
49440a403fSchristos  {
50440a403fSchristos    *(.data)
51440a403fSchristos    ${RELOCATING+*(.gcc_exc*)}
52440a403fSchristos    ${RELOCATING+___EH_FRAME_BEGIN__ = . ;}
53440a403fSchristos    ${RELOCATING+*(.eh_fram*)}
54440a403fSchristos    ${RELOCATING+___EH_FRAME_END__ = . ;}
55440a403fSchristos    ${RELOCATING+LONG(0);}
56440a403fSchristos    ${RELOCATING+ _edata = . ; }
57440a403fSchristos  }
58440a403fSchristos  .bss ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} :
59440a403fSchristos  {
60440a403fSchristos    ${RELOCATING+ _bss_start = . ; }
61440a403fSchristos    *(.bss)
62440a403fSchristos    *(COMMON)
63440a403fSchristos    ${RELOCATING+ _end = . ;  }
64440a403fSchristos  }
65440a403fSchristos  .stack :
66440a403fSchristos  {
67440a403fSchristos    ${RELOCATING+ _stack = . ; }
68440a403fSchristos    *(.stack)
69440a403fSchristos  }
70440a403fSchristos  .stab 0 ${RELOCATING+(NOLOAD)} :
71440a403fSchristos  {
72440a403fSchristos    *(.stab)
73440a403fSchristos  }
74440a403fSchristos  .stabstr 0 ${RELOCATING+(NOLOAD)} :
75440a403fSchristos  {
76440a403fSchristos    *(.stabstr)
77440a403fSchristos  }
78440a403fSchristos}
79440a403fSchristosEOF
80440a403fSchristos
81440a403fSchristos
82440a403fSchristos
83440a403fSchristos
84