]>
Commit | Line | Data |
---|---|---|
64a910f3 AB |
1 | SECTIONS {\r |
2 | /*\r | |
3 | * Put the .text section at 0x0 explicitly. While we know it will minimally\r | |
4 | * end up at 0x280, (the size of the PE/COFF headers being 0x250 bytes and the\r | |
5 | * minimum alignment 0x40), choosing 0x280 as the offset causes problems when\r | |
6 | * linking objects with a greater .text alignment, since the section's base\r | |
7 | * must adhere to its own alignment.\r | |
8 | * Using 0x0 will result in the PE/COFF binary's memory layout to be shifted\r | |
9 | * with respect to the ELF version, but this shouldn't be a problem as long as\r | |
10 | * the .data's offset relative to .text is kept the same.\r | |
11 | */\r | |
12 | .text 0x0 : ALIGN(0x40) {\r | |
13 | *(.text .text.* .rodata .rodata.*)\r | |
14 | }\r | |
15 | \r | |
16 | /*\r | |
17 | * The alignment of the .data section needs to be less than or equal to the\r | |
18 | * alignment of the .text section. This ensures that the relative offset\r | |
19 | * between these sections is the same in the ELF and the PE/COFF version of\r | |
20 | * this binary.\r | |
21 | */\r | |
22 | .data : ALIGN(0x40) {\r | |
23 | *(.data .data.*)\r | |
24 | *(.bss .bss.* *COM*)\r | |
25 | }\r | |
26 | .rela ALIGN(0x20) : {\r | |
27 | *(.rela .rela.*)\r | |
28 | }\r | |
29 | \r | |
30 | /DISCARD/ : {\r | |
31 | *(.note.GNU-stack)\r | |
32 | *(.interp)\r | |
33 | *(.dynsym)\r | |
34 | *(.dynstr)\r | |
35 | *(.dynamic)\r | |
36 | *(.hash)\r | |
37 | *(.comment)\r | |
38 | }\r | |
39 | }\r |