1 1.5.2.1 christos #include "assym.h" 2 1.5.2.1 christos 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.5.2.1 christos 9 1.1 matt SECTIONS 10 1.1 matt { 11 1.5.2.1 christos .text : 12 1.5.2.1 christos { 13 1.5.2.1 christos PROVIDE(__kernel_text = .); 14 1.5.2.1 christos *(.text) 15 1.5.2.1 christos *(.text.*) 16 1.5.2.1 christos *(.stub) 17 1.5.2.1 christos } =0 18 1.5.2.1 christos 19 1.5.2.1 christos /* Move .rodata to the next L2 block to set unexecutable */ 20 1.5.2.1 christos . = ALIGN(L2_SIZE); 21 1.5.2.1 christos 22 1.5.2.1 christos PROVIDE(__rodata_start = .); 23 1.5.2.1 christos .rodata : 24 1.5.2.1 christos { 25 1.5.2.1 christos *(.rodata) 26 1.5.2.1 christos *(.rodata.*) 27 1.5.2.1 christos . = ALIGN(64); 28 1.5.2.1 christos __CTOR_LIST__ = .; 29 1.5.2.1 christos *(.ctors) 30 1.5.2.1 christos *(.init_array) 31 1.5.2.1 christos __CTOR_END__ = .; 32 1.5.2.1 christos } 33 1.5.2.1 christos 34 1.5.2.1 christos PROVIDE(_etext = .); 35 1.5.2.1 christos PROVIDE(etext = .); 36 1.5.2.1 christos 37 1.5.2.1 christos /* 38 1.5.2.1 christos * Adjust the address for the data segment. Move .data to the next 39 1.5.2.1 christos * L2 block, and .text and .rodata will be set readonly if needed. 40 1.5.2.1 christos */ 41 1.5.2.1 christos PROVIDE(_erodata = .); 42 1.5.2.1 christos . = ALIGN(L2_SIZE); 43 1.5.2.1 christos 44 1.5.2.1 christos .data : 45 1.5.2.1 christos { 46 1.5.2.1 christos PROVIDE(__data_start = .); 47 1.5.2.1 christos *(.data) 48 1.5.2.1 christos } 49 1.5.2.1 christos 50 1.5.2.1 christos . = ALIGN(COHERENCY_UNIT); 51 1.5.2.1 christos .data.cacheline_aligned : 52 1.5.2.1 christos { 53 1.5.2.1 christos *(.data.cacheline_aligned) 54 1.5.2.1 christos } 55 1.5.2.1 christos . = ALIGN(COHERENCY_UNIT); 56 1.5.2.1 christos .data.read_mostly : 57 1.5.2.1 christos { 58 1.5.2.1 christos *(.data.read_mostly) 59 1.5.2.1 christos } 60 1.5.2.1 christos . = ALIGN(COHERENCY_UNIT); 61 1.5.2.1 christos 62 1.5.2.1 christos _edata = .; 63 1.5.2.1 christos PROVIDE (edata = .); 64 1.5.2.1 christos 65 1.5.2.1 christos __bss_start = .; 66 1.5.2.1 christos __bss_start__ = .; 67 1.5.2.1 christos .bss : 68 1.5.2.1 christos { 69 1.5.2.1 christos *(.bss) 70 1.5.2.1 christos *(.bss.*) 71 1.5.2.1 christos *(COMMON) 72 1.5.2.1 christos 73 1.5.2.1 christos /* 74 1.5.2.1 christos * Align here to ensure that the .bss section occupies space 75 1.5.2.1 christos * up to _end. Align after .bss to ensure correct alignment 76 1.5.2.1 christos * even if the .bss section disappears because there are no 77 1.5.2.1 christos * input sections. 78 1.5.2.1 christos * 79 1.5.2.1 christos * FIXME: Why do we need it? When there is no .bss section, 80 1.5.2.1 christos * we don't pad the .data section. 81 1.5.2.1 christos */ 82 1.5.2.1 christos . = ALIGN(. != 0 ? 32 / 8 : 1); 83 1.5.2.1 christos } 84 1.5.2.1 christos _bss_end__ = . ; 85 1.5.2.1 christos __bss_end__ = . ; 86 1.5.2.1 christos . = ALIGN(32 / 8); 87 1.5.2.1 christos 88 1.5.2.1 christos __end__ = . ; 89 1.5.2.1 christos _end = .; 90 1.5.2.1 christos PROVIDE(end = .); 91 1.1 matt } 92