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