fc5a306fb61ef00802de2d4d0e29eb923270617b
[psx_test1] / psx.ld
1 ENTRY(_start)
2
3 MEMORY {
4         ram : ORIGIN = 0x80010000 - 0x800, LENGTH = 2M - 0x10000 + 0x800
5         dcache : ORIGIN = 0x1f800000, LENGTH = 0x400
6 }
7
8 _stacktop = ORIGIN(ram) + LENGTH(ram) - 16;
9 _dcache = ORIGIN(dcache);
10 _dcache_end = ORIGIN(dcache) + LENGTH(dcache);
11 _progsize = _imgend - _start;
12
13 SECTIONS {
14         /* put the exe header at the start, and pad it to 2k */
15         .exehdr : {
16                 * (.exehdr);
17                 . = ALIGN(0x800);
18         } >ram
19
20         .text : {
21                 /* the entry point should go first */
22                 * (.startup);
23                 * (.text*);
24         } >ram
25
26         .rodata : { * (.rodata*); } >ram
27         .data : { * (.data*); } >ram
28
29         _gp = ALIGN(16) + 0x7ff0;
30         .sdata : {
31                 * (.sdata*);
32                 KEEP(*(.keep));
33         } >ram
34
35         _imgend = .;
36
37         .bss ALIGN(4) : {
38                 _bss_start = .;
39                 /* .sbss first to be reachable by _gp */
40                 * (.sbss*);
41                 * (.bss*);
42                 * (COMMON)
43                 . = ALIGN(4);
44                 _bss_end = .;
45         }
46
47         _end = .;
48
49         /DISCARD/ : {
50                 *(.note.GNU-stack);
51                 *(.comment);
52         }
53 }