From f981ba17eb57c47b57563d24d3d5af3ce3546ed6 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Wed, 6 May 2009 05:08:22 +0000 Subject: Flatten vendor/binutils/dist. --- ld/scripttempl/README | 4 + ld/scripttempl/alpha.sc | 74 ++++++++ ld/scripttempl/aout.sc | 57 +++++++ ld/scripttempl/armaout.sc | 35 ++++ ld/scripttempl/armcoff.sc | 84 +++++++++ ld/scripttempl/elf.sc | 404 ++++++++++++++++++++++++++++++++++++++++++++ ld/scripttempl/elfppc.sc | 288 +++++++++++++++++++++++++++++++ ld/scripttempl/i386coff.sc | 43 +++++ ld/scripttempl/mips.sc | 72 ++++++++ ld/scripttempl/mipsbsd.sc | 30 ++++ ld/scripttempl/nw.sc | 130 ++++++++++++++ ld/scripttempl/pe.sc | 171 +++++++++++++++++++ ld/scripttempl/ppcpe.sc | 198 ++++++++++++++++++++++ ld/scripttempl/sh.sc | 64 +++++++ ld/scripttempl/sparccoff.sc | 48 ++++++ ld/scripttempl/tic30aout.sc | 34 ++++ ld/scripttempl/tic30coff.sc | 58 +++++++ ld/scripttempl/v850.sc | 230 +++++++++++++++++++++++++ ld/scripttempl/vanilla.sc | 1 + ld/scripttempl/z8000.sc | 57 +++++++ 20 files changed, 2082 insertions(+) create mode 100644 ld/scripttempl/README create mode 100644 ld/scripttempl/alpha.sc create mode 100644 ld/scripttempl/aout.sc create mode 100644 ld/scripttempl/armaout.sc create mode 100644 ld/scripttempl/armcoff.sc create mode 100644 ld/scripttempl/elf.sc create mode 100644 ld/scripttempl/elfppc.sc create mode 100644 ld/scripttempl/i386coff.sc create mode 100644 ld/scripttempl/mips.sc create mode 100644 ld/scripttempl/mipsbsd.sc create mode 100644 ld/scripttempl/nw.sc create mode 100644 ld/scripttempl/pe.sc create mode 100644 ld/scripttempl/ppcpe.sc create mode 100644 ld/scripttempl/sh.sc create mode 100644 ld/scripttempl/sparccoff.sc create mode 100644 ld/scripttempl/tic30aout.sc create mode 100644 ld/scripttempl/tic30coff.sc create mode 100644 ld/scripttempl/v850.sc create mode 100644 ld/scripttempl/vanilla.sc create mode 100644 ld/scripttempl/z8000.sc (limited to 'ld/scripttempl') diff --git a/ld/scripttempl/README b/ld/scripttempl/README new file mode 100644 index 000000000000..26ad2e934e2e --- /dev/null +++ b/ld/scripttempl/README @@ -0,0 +1,4 @@ +The files in this directory are linker script templates. +genscripts.sh sets some shell variables, then sources +EMULATION.sc, to generate EMULATION.{x,xr,xu,xn,xbn} -- the script +files for default, -r, -Ur, -n, -N. diff --git a/ld/scripttempl/alpha.sc b/ld/scripttempl/alpha.sc new file mode 100644 index 000000000000..44a10c469cd2 --- /dev/null +++ b/ld/scripttempl/alpha.sc @@ -0,0 +1,74 @@ +# Linker script for Alpha systems. +# Ian Lance Taylor . +# These variables may be overridden by the emulation file. The +# defaults are appropriate for an Alpha running OSF/1. +test -z "$ENTRY" && ENTRY=__start +test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x120000000 + SIZEOF_HEADERS" +if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then + DATA_ADDR=. +else + test -z "$DATA_ADDR" && DATA_ADDR=0x140000000 +fi +cat <. +test -z "$ENTRY" && ENTRY=_start +if test -z "${DATA_ADDR}"; then + if test "$LD_FLAG" = "N" || test "$LD_FLAG" = "n"; then + DATA_ADDR=. + fi +fi + +# These are substituted in as variables in order to get '}' in a shell +# conditional expansion. +CTOR='.ctor : { + *(SORT(.ctors.*)) + *(.ctor) + }' +DTOR='.dtor : { + *(SORT(.dtors.*)) + *(.dtor) + }' + +cat <. +test -z "$ENTRY" && ENTRY=_start +# These are substituted in as variables in order to get '}' in a shell +# conditional expansion. +INIT='.init : { *(.init) }' +FINI='.fini : { *(.fini) }' +cat <. +# These variables may be overridden by the emulation file. The +# defaults are appropriate for a DECstation running Ultrix. +test -z "$ENTRY" && ENTRY=__start + +if [ -z "$EMBEDDED" ]; then + test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS" +else + test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000" +fi +if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then + DATA_ADDR=. +else + test -z "$DATA_ADDR" && DATA_ADDR=0x10000000 +fi +cat < ram} + ${CONSTRUCTING+${TORS}} + .data : + { + *(.data) + ${RELOCATING+*(.gcc_exc*)} + ${RELOCATING+___EH_FRAME_BEGIN__ = . ;} + ${RELOCATING+*(.eh_fram*)} + ${RELOCATING+___EH_FRAME_END__ = . ;} + ${RELOCATING+LONG(0);} + ${RELOCATING+ _edata = . ; } + } ${RELOCATING+ > ram} + .bss : + { + ${RELOCATING+ _bss_start = . ; } + *(.bss) + *(COMMON) + ${RELOCATING+ _end = . ; } + } ${RELOCATING+ > ram} + .stack ${RELOCATING+ 0x30000 } : + { + ${RELOCATING+ _stack = . ; } + *(.stack) + } ${RELOCATING+ > ram} + .stab 0 ${RELOCATING+(NOLOAD)} : + { + *(.stab) + } + .stabstr 0 ${RELOCATING+(NOLOAD)} : + { + *(.stabstr) + } +} +EOF + + + + diff --git a/ld/scripttempl/sparccoff.sc b/ld/scripttempl/sparccoff.sc new file mode 100644 index 000000000000..6bbb7ad6e903 --- /dev/null +++ b/ld/scripttempl/sparccoff.sc @@ -0,0 +1,48 @@ +# Linker script for Sparc COFF. +# Based on i386coff.sc by Ian Taylor . +test -z "$ENTRY" && ENTRY=_start +cat < rom + +.const : +{ + *(.const) + __etext = . ; +} > rom + +.mdata : AT( ADDR(.const) + SIZEOF(.const) ) +{ + __data = . ; + *(.data); + __edata = . ; +} > ram + +.bss : +{ + __bss = . ; + *(.bss); + *(COMMON); + __ebss = . ; +} > ram + +.ram0 : +{ + *(ram0) +} > ramblk0 + +.ram1 : +{ + *(ram1) +} > ramblk1 + +} + +EOF diff --git a/ld/scripttempl/v850.sc b/ld/scripttempl/v850.sc new file mode 100644 index 000000000000..8958321b2b95 --- /dev/null +++ b/ld/scripttempl/v850.sc @@ -0,0 +1,230 @@ +cat << EOF +OUTPUT_FORMAT("elf32-v850", "elf32-v850", + "elf32-v850") +OUTPUT_ARCH(v850) +ENTRY(_start) +SEARCH_DIR(.); +SECTIONS +{ + /* This saves a little space in the ELF file, since the zda starts + at a higher location that the ELF headers take up. */ + + .zdata ${ZDATA_START_ADDR} : + { + *(.zdata) + *(.zbss) + *(reszdata) + *(.zcommon) + } + + /* This is the read only part of the zero data area. + Having it as a seperate section prevents its + attributes from being inherited by the zdata + section. Specifically it prevents the zdata + section from being marked READONLY. */ + + .rozdata ${ROZDATA_START_ADDR} : + { + *(.rozdata) + *(romzdata) + *(romzbss) + } + + /* Read-only sections, merged into text segment. */ + . = ${TEXT_START_ADDR}; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .rel.text : { *(.rel.text) } + .rela.text : { *(.rela.text) } + .rel.data : { *(.rel.data) } + .rela.data : { *(.rela.data) } + .rel.rodata : { *(.rel.rodata) } + .rela.rodata : { *(.rela.rodata) } + .rel.gcc_except_table : { *(.rel.gcc_except_table) } + .rela.gcc_except_table : { *(.rela.gcc_except_table) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : { KEEP (*(.init)) } =0 + .plt : { *(.plt) } + + .text : + { + *(.text) + ${RELOCATING+*(.text.*)} + + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + } =0 + + ${RELOCATING+_etext = .;} + ${RELOCATING+PROVIDE (etext = .);} + + /* This is special code area at the end of the normal text section. + It contains a small lookup table at the start followed by the + code pointed to by entries in the lookup table. */ + + .call_table_data ${CALL_TABLE_START_ADDR} : + { + ${RELOCATING+PROVIDE(__ctbp = .);} + *(.call_table_data) + } = 0xff /* Fill gaps with 0xff. */ + + .call_table_text : + { + *(.call_table_text) + } + + .fini : { KEEP (*(.fini)) } =0 + .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) } + .rodata1 : { *(.rodata1) } + + .data : + { + *(.data) + ${RELOCATING+*(.data.*)} + *(.gnu.linkonce.d*) + CONSTRUCTORS + } + .data1 : { *(.data1) } + .ctors : + { + ${CONSTRUCTING+___ctors = .;} + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend(.ctors)) + ${CONSTRUCTING+___ctors_end = .;} + } + .dtors : + { + ${CONSTRUCTING+___dtors = .;} + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + ${CONSTRUCTING+___dtors_end = .;} + } + .jcr : + { + KEEP (*(.jcr)) + } + + .gcc_except_table : { *(.gcc_except_table) } + + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + + .tdata ${TDATA_START_ADDR} : + { + ${RELOCATING+PROVIDE (__ep = .);} + *(.tbyte) + *(.tcommon_byte) + *(.tdata) + *(.tbss) + *(.tcommon) + } + + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + + .sdata ${SDATA_START_ADDR} : + { + ${RELOCATING+PROVIDE (__gp = . + 0x8000);} + *(.sdata) + } + + /* See comment about .rozdata. */ + .rosdata ${ROSDATA_START_ADDR} : + { + *(.rosdata) + } + + /* We place the .sbss data section AFTER the .rosdata section, so that + it can directly preceed the .bss section. This allows runtime startup + code to initialise all the zero-data sections by simply taking the + value of '_edata' and zeroing until it reaches '_end'. */ + + .sbss : + { + ${RELOCATING+__sbss_start = .;} + *(.sbss) + *(.scommon) + } + + ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;} + ${RELOCATING+PROVIDE (edata = _edata);} + + .bss : + { + ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;} + ${RELOCATING+__real_bss_start = . ;} + *(.dynbss) + *(.bss) + *(COMMON) + } + + ${RELOCATING+_end = . ;} + ${RELOCATING+PROVIDE (end = .);} + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* SGI/MIPS DWARF 2 extensions. */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + /* User stack. */ + .stack 0x200000 : + { + ${RELOCATING+__stack = .;} + *(.stack) + } +} +EOF diff --git a/ld/scripttempl/vanilla.sc b/ld/scripttempl/vanilla.sc new file mode 100644 index 000000000000..1798480e69b0 --- /dev/null +++ b/ld/scripttempl/vanilla.sc @@ -0,0 +1 @@ +# Nothing to do. diff --git a/ld/scripttempl/z8000.sc b/ld/scripttempl/z8000.sc new file mode 100644 index 000000000000..646c88080a9a --- /dev/null +++ b/ld/scripttempl/z8000.sc @@ -0,0 +1,57 @@ +cat <