1 /* Default linker script, for normal executables */ 2 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", 3 "elf64-littleaarch64") 4 OUTPUT_ARCH(aarch64) 5 ENTRY(_start) 6 SECTIONS 7 { 8 /* Read-only sections, merged into text segment: */ 9 PROVIDE (__kernel_text = .; 10 .text : 11 { 12 PROVIDE_HIDDEN (__eprol = .); 13 *(.text) 14 *(.text.unlikely .text.*_unlikely) 15 *(.text.exit .text.exit.*) 16 *(.text.startup .text.startup.*) 17 *(.text.hot .text.hot.*) 18 *(.stub .text.* .gnu.linkonce.t.*) 19 /* .gnu.warning sections are handled specially by elf32.em. */ 20 . = ALIGN(0x800) 21 *(.vectors) 22 } =0 23 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 24 .rodata1 : { *(.rodata1) } 25 .eh_frame_hdr : { *(.eh_frame_hdr) } 26 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } 27 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table 28 .gcc_except_table.*) } 29 /* These sections are generated by the Sun/Oracle C++ compiler. */ 30 .exception_ranges : ONLY_IF_RO { *(.exception_ranges 31 .exception_ranges*) } 32 PROVIDE (__etext = .); 33 PROVIDE (_etext = .); 34 PROVIDE (etext = .); 35 /* Adjust the address for the data segment. We want to adjust up to 36 the same address within the page on the next page up. */ 37 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 38 /* Exception handling */ 39 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } 40 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 41 .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } 42 .got : { *(.got) *(.igot) } 43 . = DATA_SEGMENT_RELRO_END (24, .); 44 .got.plt : { *(.got.plt) *(.igot.plt) } 45 .data : 46 { 47 PROVIDE (__data_start = .); 48 *(.data .data.* .gnu.linkonce.d.*) 49 SORT(CONSTRUCTORS) 50 } 51 .data1 : { *(.data1) } 52 _edata = .; PROVIDE (edata = .); 53 . = .; 54 __bss_start = .; 55 __bss_start__ = .; 56 .bss : 57 { 58 *(.dynbss) 59 *(.bss .bss.* .gnu.linkonce.b.*) 60 *(COMMON) 61 /* Align here to ensure that the .bss section occupies space up to 62 _end. Align after .bss to ensure correct alignment even if the 63 .bss section disappears because there are no input sections. 64 FIXME: Why do we need it? When there is no .bss section, we don't 65 pad the .data section. */ 66 . = ALIGN(. != 0 ? 32 / 8 : 1); 67 } 68 _bss_end__ = . ; __bss_end__ = . ; 69 . = ALIGN(32 / 8); 70 . = ALIGN(32 / 8); 71 __end__ = . ; 72 _end = .; PROVIDE (end = .); 73 . = DATA_SEGMENT_END (.); 74 .comment 0 : { *(.comment) } 75 .ident 0 : { *(.ident) } 76 /* DWARF debug sections. 77 Symbols in the DWARF debugging sections are relative to the beginning 78 of the section so we begin them at 0. */ 79 /* DWARF 1 */ 80 .debug 0 : { *(.debug) } 81 .line 0 : { *(.line) } 82 /* GNU DWARF 1 extensions */ 83 .debug_srcinfo 0 : { *(.debug_srcinfo) } 84 .debug_sfnames 0 : { *(.debug_sfnames) } 85 /* DWARF 1.1 and DWARF 2 */ 86 .debug_aranges 0 : { *(.debug_aranges) } 87 .debug_pubnames 0 : { *(.debug_pubnames) } 88 /* DWARF 2 */ 89 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 90 .debug_abbrev 0 : { *(.debug_abbrev) } 91 .debug_line 0 : { *(.debug_line) } 92 .debug_frame 0 : { *(.debug_frame) } 93 .debug_str 0 : { *(.debug_str) } 94 .debug_loc 0 : { *(.debug_loc) } 95 .debug_macinfo 0 : { *(.debug_macinfo) } 96 /* SGI/MIPS DWARF 2 extensions */ 97 .debug_weaknames 0 : { *(.debug_weaknames) } 98 .debug_funcnames 0 : { *(.debug_funcnames) } 99 .debug_typenames 0 : { *(.debug_typenames) } 100 .debug_varnames 0 : { *(.debug_varnames) } 101 /* DWARF 3 */ 102 .debug_pubtypes 0 : { *(.debug_pubtypes) } 103 .debug_ranges 0 : { *(.debug_ranges) } 104 /* DWARF Extension. */ 105 .debug_macro 0 : { *(.debug_macro) } 106 .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) } 107 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } 108 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) } 109 } 110