1 1.4.2.2 pgoyette #include "assym.h" 2 1.4.2.2 pgoyette 3 1.1 matt /* Default linker script, for normal executables */ 4 1.1 matt OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", 5 1.1 matt "elf64-littleaarch64") 6 1.1 matt OUTPUT_ARCH(aarch64) 7 1.1 matt ENTRY(_start) 8 1.4.2.2 pgoyette 9 1.1 matt SECTIONS 10 1.1 matt { 11 1.4.2.2 pgoyette .text : 12 1.4.2.2 pgoyette { 13 1.4.2.2 pgoyette PROVIDE (__kernel_text = .); 14 1.4.2.2 pgoyette PROVIDE_HIDDEN (__eprol = .); 15 1.4.2.2 pgoyette *(.text) 16 1.4.2.2 pgoyette *(.text.unlikely .text.*_unlikely) 17 1.4.2.2 pgoyette *(.text.exit .text.exit.*) 18 1.4.2.2 pgoyette *(.text.startup .text.startup.*) 19 1.4.2.2 pgoyette *(.text.hot .text.hot.*) 20 1.4.2.2 pgoyette *(.stub .text.* .gnu.linkonce.t.*) 21 1.4.2.2 pgoyette /* .gnu.warning sections are handled specially by elf32.em. */ 22 1.4.2.2 pgoyette } =0 23 1.4.2.2 pgoyette 24 1.4.2.2 pgoyette /* Move .rodata to the next L2 block to set unexecutable */ 25 1.4.2.2 pgoyette . = ALIGN (L2_SIZE); 26 1.4.2.2 pgoyette PROVIDE (__rodata_start = .); 27 1.4.2.2 pgoyette .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 28 1.4.2.2 pgoyette .rodata1 : { *(.rodata1) } 29 1.4.2.2 pgoyette .eh_frame_hdr : { *(.eh_frame_hdr) } 30 1.4.2.2 pgoyette .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } 31 1.4.2.2 pgoyette .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table 32 1.4.2.2 pgoyette .gcc_except_table.*) } 33 1.4.2.2 pgoyette 34 1.4.2.2 pgoyette /* These sections are generated by the Sun/Oracle C++ compiler. */ 35 1.4.2.2 pgoyette .exception_ranges : ONLY_IF_RO { *(.exception_ranges 36 1.4.2.2 pgoyette .exception_ranges*) } 37 1.4.2.2 pgoyette PROVIDE (__etext = .); 38 1.4.2.2 pgoyette PROVIDE (_etext = .); 39 1.4.2.2 pgoyette PROVIDE (etext = .); 40 1.4.2.2 pgoyette 41 1.4.2.2 pgoyette /* 42 1.4.2.2 pgoyette * Adjust the address for the data segment. Move .data to the next 43 1.4.2.2 pgoyette * L2 block, and .text and .rodata will be set readonly if needed. 44 1.4.2.2 pgoyette */ 45 1.4.2.2 pgoyette PROVIDE (_erodata = .); 46 1.4.2.2 pgoyette . = ALIGN (L2_SIZE); 47 1.4.2.2 pgoyette . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 48 1.4.2.2 pgoyette /* Exception handling */ 49 1.4.2.2 pgoyette .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } 50 1.4.2.2 pgoyette .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 51 1.4.2.2 pgoyette .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } 52 1.4.2.2 pgoyette .got : { *(.got) *(.igot) } 53 1.4.2.2 pgoyette . = DATA_SEGMENT_RELRO_END (24, .); 54 1.4.2.2 pgoyette .got.plt : { *(.got.plt) *(.igot.plt) } 55 1.4.2.2 pgoyette .data : 56 1.4.2.2 pgoyette { 57 1.4.2.2 pgoyette PROVIDE (__data_start = .); 58 1.4.2.2 pgoyette *(.data .gnu.linkonce.d.*) 59 1.4.2.2 pgoyette SORT(CONSTRUCTORS) 60 1.4.2.2 pgoyette } 61 1.4.2.2 pgoyette .data1 : { *(.data1) } 62 1.4.2.2 pgoyette 63 1.4.2.2 pgoyette . = ALIGN(64); /* COHERENCY_UNIT */ 64 1.4.2.2 pgoyette .data.cacheline_aligned : 65 1.4.2.2 pgoyette { 66 1.4.2.2 pgoyette *(.data.cacheline_aligned) 67 1.4.2.2 pgoyette } 68 1.4.2.2 pgoyette . = ALIGN(64); /* COHERENCY_UNIT */ 69 1.4.2.2 pgoyette .data.read_mostly : 70 1.4.2.2 pgoyette { 71 1.4.2.2 pgoyette *(.data.read_mostly) 72 1.4.2.2 pgoyette } 73 1.4.2.2 pgoyette . = ALIGN(64); /* COHERENCY_UNIT */ 74 1.4.2.2 pgoyette 75 1.4.2.2 pgoyette _edata = .; PROVIDE (edata = .); 76 1.4.2.2 pgoyette . = .; 77 1.4.2.2 pgoyette 78 1.4.2.2 pgoyette __bss_start = .; 79 1.4.2.2 pgoyette __bss_start__ = .; 80 1.4.2.2 pgoyette .bss : 81 1.4.2.2 pgoyette { 82 1.4.2.2 pgoyette *(.dynbss) 83 1.4.2.2 pgoyette *(.bss .bss.* .gnu.linkonce.b.*) 84 1.4.2.2 pgoyette *(COMMON) 85 1.4.2.2 pgoyette 86 1.4.2.2 pgoyette /* 87 1.4.2.2 pgoyette * Align here to ensure that the .bss section occupies space 88 1.4.2.2 pgoyette * up to _end. Align after .bss to ensure correct alignment 89 1.4.2.2 pgoyette * even if the .bss section disappears because there are no 90 1.4.2.2 pgoyette * input sections. 91 1.4.2.2 pgoyette * 92 1.4.2.2 pgoyette * FIXME: Why do we need it? When there is no .bss section, 93 1.4.2.2 pgoyette * we don't pad the .data section. 94 1.4.2.2 pgoyette */ 95 1.4.2.2 pgoyette . = ALIGN(. != 0 ? 32 / 8 : 1); 96 1.4.2.2 pgoyette } 97 1.4.2.2 pgoyette _bss_end__ = . ; __bss_end__ = . ; 98 1.4.2.2 pgoyette . = ALIGN(32 / 8); 99 1.4.2.2 pgoyette . = ALIGN(32 / 8); 100 1.4.2.2 pgoyette 101 1.4.2.2 pgoyette __end__ = . ; 102 1.4.2.2 pgoyette _end = .; PROVIDE (end = .); 103 1.4.2.2 pgoyette . = DATA_SEGMENT_END (.); 104 1.4.2.2 pgoyette .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) } 105 1.4.2.2 pgoyette .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } 106 1.1 matt } 107