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