summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds
blob: c9515578c8267f460ea9e0cc16e34e34ebe22da3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 * Declare some sizes.
 */
_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0;
_RamSize = DEFINED(_RamSize) ? _RamSize : 16M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;

ENTRY("_start")
/* The memory size is 16M to coincide with the simulator.
   Don't change either without considering the other.  */
MEMORY
{
  /* 0xc4 is a magic entry.  We should have the linker just
  skip over it one day... */
  vectors : o = 0x0000, l = 0xc4
  magicvectors : o = 0xc4, l = 0x3c
  /* We still only use 256k as the main ram size.  */
  ram    : o = 0x0100, l = 0xfffefc /* 16MB RAM --> 0x3fefc */
  /* The stack starts at the top of main ram.  */
  topram : o = 0xfffffc, l = 0x4  /* 256K RAM --> 0x3fffc */
  /* This holds variables in the "tiny" sections.  */
  tiny   : o = 0xff8000, l = 0x7f00
  /* At the very top of the address space is the 8-bit area.  */
  eight  : o = 0xffff00, l = 0x100
}


SECTIONS
{
   .vectors :
   {
        *(.vectors)
   }  > vectors

    .text :
    {
	*(.text*)
	*(.gnu.linkonce.t*)
	
        /*
         * Special FreeBSD sysctl sections.
         */
        . = ALIGN (16);
        ___start_set_sysctl_set = .;
        *(set_sys*);                            /* sysctl set */
        ___stop_set_sysctl_set = ABSOLUTE(.);
        *(set_dom*);                            /* domain set */
        *(set_pse*);

        /*
         * Read-only data
         */
        . = ALIGN (16);
        PROVIDE(_rodata_start = . );
        *(.rodata*)
        *(.gnu.linkonce.r*)
        PROVIDE(_erodata = . );

	 _etext = .;
    }  >ram
    .tdata SIZEOF(.text) + ADDR(.text): {
        __TLS_Data_begin = .;
        *(.tdata .tdata.* .gnu.linkonce.td.*)
        __TLS_Data_end = .;
    }  >ram
    .tbss SIZEOF(.tdata) + ADDR(.tdata): {
        __TLS_BSS_begin = .;
        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
        __TLS_BSS_end = .;
    }  >ram
    __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
    __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
    __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
    __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
    __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
    __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
   .tors SIZEOF(.tbss) + ADDR(.tbss): {
        ___ctors = . ;
        *(.ctors)
        ___ctors_end = . ;
        ___dtors = . ;
        *(.dtors)
        ___dtors_end = . ;
    }  >ram
    .data SIZEOF(.tors) + ADDR(.tors):
    {
 	*(.data*)
        *(.gcc_exc*)
	CONSTRUCTORS
	 _edata = .;
    }  >ram
    .bss SIZEOF(.data) + ADDR(.data):
    {
	 _bss_start = .;
	*(.bss* .gnu.linkonce.b.*)
	*(COMMON)
	. = ALIGN (64);
	. += _StackSize;
	_stack_init = .;
	_clear_end = .;
	_WorkAreaBase = .;
	 _end = .;
	 __end = .;
    } >ram
    .tiny : {
        *(.tiny)
    }  > tiny
    .eight : {
        *(.eight)
    }  > eight
    .stab 0 (NOLOAD) : {
        [ .stab ]
    }
    .stabstr 0 (NOLOAD) : {
        [ .stabstr ]
    }

}