xref: /netbsd-src/external/gpl3/binutils.old/dist/ld/scripttempl/moxie.sc (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1# Copyright (C) 2014-2020 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  } > ram"
16
17cat <<EOF
18/* Copyright (C) 2014-2020 Free Software Foundation, Inc.
19
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.  */
23
24OUTPUT_FORMAT("${OUTPUT_FORMAT}")
25OUTPUT_ARCH(${ARCH})
26
27SECTIONS
28{
29  .text :
30  {
31    *(.text)
32    ${RELOCATING+KEEP (*(SORT_NONE(.init)))
33    KEEP (*(SORT_NONE(.fini)))
34    *(.strings)
35    _etext = . ; }
36  } ${RELOCATING+ > ram}
37  ${CONSTRUCTING+${TORS}}
38  .data :
39  {
40    *(.data)
41    ${RELOCATING+ _edata = . ; }
42  } ${RELOCATING+ > ram}
43  .bss :
44  {
45    ${RELOCATING+ _bss_start = . ; }
46    *(.bss)
47    *(COMMON)
48    ${RELOCATING+ _end = . ;  }
49  } ${RELOCATING+ > ram}
50  .stack ${RELOCATING+ 0x30000 }  :
51  {
52    ${RELOCATING+ _stack = . ; }
53    *(.stack)
54  } ${RELOCATING+ > ram}
55  .stab 0 ${RELOCATING+(NOLOAD)} :
56  {
57    *(.stab)
58  }
59  .stabstr 0 ${RELOCATING+(NOLOAD)} :
60  {
61    *(.stabstr)
62  }
63}
64EOF
65