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