1296183Ssgalabov/* $FreeBSD: releng/11.0/sys/boot/mips/uboot/ldscript.mips 296183 2016-02-29 07:47:04Z sgalabov $ */ 2296183Ssgalabov 3296183SsgalabovOUTPUT_ARCH(mips) 4296183SsgalabovENTRY(_start) 5296183SsgalabovSECTIONS 6296183Ssgalabov{ 7296183Ssgalabov /* Read-only sections, merged into text segment: */ 8296183Ssgalabov /*. = UBLDR_LOADADDR + SIZEOF_HEADERS;*/ 9296183Ssgalabov . = UBLDR_LOADADDR; 10296183Ssgalabov .text : 11296183Ssgalabov { 12296183Ssgalabov start.o(.text*) 13296183Ssgalabov *(EXCLUDE_FILE (start.o) .text*) 14296183Ssgalabov /* .gnu.warning sections are handled specially by elf32.em. */ 15296183Ssgalabov *(.gnu.warning) 16296183Ssgalabov *(.gnu.linkonce.t*) 17296183Ssgalabov } =0 18296183Ssgalabov _etext = .; 19296183Ssgalabov PROVIDE (etext = .); 20296183Ssgalabov .interp : { *(.interp) } 21296183Ssgalabov .hash : { *(.hash) } 22296183Ssgalabov .dynsym : { *(.dynsym) } 23296183Ssgalabov .dynstr : { *(.dynstr) } 24296183Ssgalabov .gnu.version : { *(.gnu.version) } 25296183Ssgalabov .gnu.version_d : { *(.gnu.version_d) } 26296183Ssgalabov .gnu.version_r : { *(.gnu.version_r) } 27296183Ssgalabov .rela.text : 28296183Ssgalabov { *(.rela.text) *(.rela.gnu.linkonce.t*) } 29296183Ssgalabov .rela.data : 30296183Ssgalabov { *(.rela.data) *(.rela.gnu.linkonce.d*) } 31296183Ssgalabov .rela.rodata : 32296183Ssgalabov { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } 33296183Ssgalabov .rela.got : { *(.rela.got) } 34296183Ssgalabov .rela.got1 : { *(.rela.got1) } 35296183Ssgalabov .rela.got2 : { *(.rela.got2) } 36296183Ssgalabov .rela.ctors : { *(.rela.ctors) } 37296183Ssgalabov .rela.dtors : { *(.rela.dtors) } 38296183Ssgalabov .rela.init : { *(.rela.init) } 39296183Ssgalabov .rela.fini : { *(.rela.fini) } 40296183Ssgalabov .rela.bss : { *(.rela.bss) } 41296183Ssgalabov .rela.plt : { *(.rela.plt) } 42296183Ssgalabov .rela.sdata : { *(.rela.sdata) } 43296183Ssgalabov .rela.sbss : { *(.rela.sbss) } 44296183Ssgalabov .rela.sdata2 : { *(.rela.sdata2) } 45296183Ssgalabov .rela.sbss2 : { *(.rela.sbss2) } 46296183Ssgalabov .init : { *(.init) } =0 47296183Ssgalabov .fini : { *(.fini) } =0 48296183Ssgalabov .rodata : { *(.rodata) *(.gnu.linkonce.r*) } 49296183Ssgalabov .rodata1 : { *(.rodata1) } 50296183Ssgalabov .sdata2 : { *(.sdata2) } 51296183Ssgalabov .sbss2 : { *(.sbss2) } 52296183Ssgalabov /* Adjust the address for the data segment to the next page up. */ 53296183Ssgalabov . = ((. + 0x1000) & ~(0x1000 - 1)); 54296183Ssgalabov .data : 55296183Ssgalabov { 56296183Ssgalabov *(.data) 57296183Ssgalabov *(.gnu.linkonce.d*) 58296183Ssgalabov CONSTRUCTORS 59296183Ssgalabov } 60296183Ssgalabov .data1 : { *(.data1) } 61296183Ssgalabov .got1 : { *(.got1) } 62296183Ssgalabov .dynamic : { *(.dynamic) } 63296183Ssgalabov /* Put .ctors and .dtors next to the .got2 section, so that the pointers 64296183Ssgalabov get relocated with -mrelocatable. Also put in the .fixup pointers. 65296183Ssgalabov The current compiler no longer needs this, but keep it around for 2.7.2 */ 66296183Ssgalabov PROVIDE (_GOT2_START_ = .); 67296183Ssgalabov .got2 : { *(.got2) } 68296183Ssgalabov PROVIDE (__CTOR_LIST__ = .); 69296183Ssgalabov .ctors : { *(.ctors) } 70296183Ssgalabov PROVIDE (__CTOR_END__ = .); 71296183Ssgalabov PROVIDE (__DTOR_LIST__ = .); 72296183Ssgalabov .dtors : { *(.dtors) } 73296183Ssgalabov PROVIDE (__DTOR_END__ = .); 74296183Ssgalabov PROVIDE (_FIXUP_START_ = .); 75296183Ssgalabov .fixup : { *(.fixup) } 76296183Ssgalabov PROVIDE (_FIXUP_END_ = .); 77296183Ssgalabov PROVIDE (_GOT2_END_ = .); 78296183Ssgalabov PROVIDE (_GOT_START_ = .); 79296183Ssgalabov .got : { *(.got) } 80296183Ssgalabov .got.plt : { *(.got.plt) } 81296183Ssgalabov PROVIDE (_GOT_END_ = .); 82296183Ssgalabov /* We want the small data sections together, so single-instruction offsets 83296183Ssgalabov can access them all, and initialized data all before uninitialized, so 84296183Ssgalabov we can shorten the on-disk segment size. */ 85296183Ssgalabov .sdata : { *(.sdata) } 86296183Ssgalabov _edata = .; 87296183Ssgalabov PROVIDE (edata = .); 88296183Ssgalabov .sbss : 89296183Ssgalabov { 90296183Ssgalabov PROVIDE (__sbss_start = .); 91296183Ssgalabov *(.sbss) 92296183Ssgalabov *(.scommon) 93296183Ssgalabov *(.dynsbss) 94296183Ssgalabov PROVIDE (__sbss_end = .); 95296183Ssgalabov } 96296183Ssgalabov .plt : { *(.plt) } 97296183Ssgalabov .bss : 98296183Ssgalabov { 99296183Ssgalabov PROVIDE (__bss_start = .); 100296183Ssgalabov *(.dynbss) 101296183Ssgalabov *(.bss) 102296183Ssgalabov *(COMMON) 103296183Ssgalabov } 104296183Ssgalabov _end = . ; 105296183Ssgalabov PROVIDE (end = .); 106296183Ssgalabov /* Stabs debugging sections. */ 107296183Ssgalabov .stab 0 : { *(.stab) } 108296183Ssgalabov .stabstr 0 : { *(.stabstr) } 109296183Ssgalabov /* DWARF debug sections. 110296183Ssgalabov Symbols in the DWARF debugging sections are relative to the beginning 111296183Ssgalabov of the section so we begin them at 0. */ 112296183Ssgalabov /* DWARF 1 */ 113296183Ssgalabov .debug 0 : { *(.debug) } 114296183Ssgalabov .line 0 : { *(.line) } 115296183Ssgalabov /* GNU DWARF 1 extensions */ 116296183Ssgalabov .debug_srcinfo 0 : { *(.debug_srcinfo) } 117296183Ssgalabov .debug_sfnames 0 : { *(.debug_sfnames) } 118296183Ssgalabov /* DWARF 1.1 and DWARF 2 */ 119296183Ssgalabov .debug_aranges 0 : { *(.debug_aranges) } 120296183Ssgalabov .debug_pubnames 0 : { *(.debug_pubnames) } 121296183Ssgalabov /* DWARF 2 */ 122296183Ssgalabov .debug_info 0 : { *(.debug_info) } 123296183Ssgalabov .debug_abbrev 0 : { *(.debug_abbrev) } 124296183Ssgalabov .debug_line 0 : { *(.debug_line) } 125296183Ssgalabov .debug_frame 0 : { *(.debug_frame) } 126296183Ssgalabov .debug_str 0 : { *(.debug_str) } 127296183Ssgalabov .debug_loc 0 : { *(.debug_loc) } 128296183Ssgalabov .debug_macinfo 0 : { *(.debug_macinfo) } 129296183Ssgalabov /* SGI/MIPS DWARF 2 extensions */ 130296183Ssgalabov .debug_weaknames 0 : { *(.debug_weaknames) } 131296183Ssgalabov .debug_funcnames 0 : { *(.debug_funcnames) } 132296183Ssgalabov .debug_typenames 0 : { *(.debug_typenames) } 133296183Ssgalabov .debug_varnames 0 : { *(.debug_varnames) } 134296183Ssgalabov /* These must appear regardless of . */ 135296183Ssgalabov} 136