diff options
author | obrien <obrien@FreeBSD.org> | 2001-05-28 05:21:37 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-05-28 05:21:37 +0000 |
commit | 328e45595b12375b6d16a846069507d25086abdb (patch) | |
tree | ae2a6f4f4987889b7bd2af7bdf0b86fa580df011 /contrib/binutils/ld/emulparams | |
parent | 7fbb72605a1c3bcb81f8b6bb6297ffef30f84335 (diff) | |
download | FreeBSD-src-328e45595b12375b6d16a846069507d25086abdb.zip FreeBSD-src-328e45595b12375b6d16a846069507d25086abdb.tar.gz |
Import of GNU Binutils version 2.11.0.
Believe it or not, this is heavily stripped down.
Diffstat (limited to 'contrib/binutils/ld/emulparams')
-rw-r--r-- | contrib/binutils/ld/emulparams/armelf.sh | 3 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/armelf_linux.sh | 9 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/elf32lppc.sh | 16 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/elf32lppcsim.sh | 18 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/elf32ppc.sh | 12 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/elf32ppclinux.sh | 12 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/elf32ppcsim.sh | 18 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/elf64_sparc.sh | 15 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/elf64alpha.sh | 55 | ||||
-rw-r--r-- | contrib/binutils/ld/emulparams/elf_i386_chaos.sh | 10 |
10 files changed, 151 insertions, 17 deletions
diff --git a/contrib/binutils/ld/emulparams/armelf.sh b/contrib/binutils/ld/emulparams/armelf.sh index 8c79b64..338b9ce 100644 --- a/contrib/binutils/ld/emulparams/armelf.sh +++ b/contrib/binutils/ld/emulparams/armelf.sh @@ -4,7 +4,8 @@ OUTPUT_FORMAT="elf32-littlearm" BIG_OUTPUT_FORMAT="elf32-bigarm" LITTLE_OUTPUT_FORMAT="elf32-littlearm" TEXT_START_ADDR=0x8000 -TEMPLATE_NAME=armelf +TEMPLATE_NAME=elf32 +EXTRA_EM_FILE=armelf OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)' OTHER_BSS_SYMBOLS='__bss_start__ = .;' OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;' diff --git a/contrib/binutils/ld/emulparams/armelf_linux.sh b/contrib/binutils/ld/emulparams/armelf_linux.sh index a85e8bd..d04d967 100644 --- a/contrib/binutils/ld/emulparams/armelf_linux.sh +++ b/contrib/binutils/ld/emulparams/armelf_linux.sh @@ -4,7 +4,8 @@ OUTPUT_FORMAT="elf32-littlearm" BIG_OUTPUT_FORMAT="elf32-bigarm" LITTLE_OUTPUT_FORMAT="elf32-littlearm" MAXPAGESIZE=0x8000 -TEMPLATE_NAME=armelf +TEMPLATE_NAME=elf32 +EXTRA_EM_FILE=armelf GENERATE_SHLIB_SCRIPT=yes DATA_START_SYMBOLS='__data_start = . ;'; @@ -12,8 +13,4 @@ OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7)' OTHER_BSS_SYMBOLS='__bss_start__ = .;' OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;' -# This needs to be high enough so that we can load ld.so below it, -# yet low enough to stay away from the mmap area at 0x40000000. -# Also, it is small enough so that relocs which are pointing -# at absolute 0 will still be fixed up. -TEXT_START_ADDR=0x02000000 +TEXT_START_ADDR=0x00008000 diff --git a/contrib/binutils/ld/emulparams/elf32lppc.sh b/contrib/binutils/ld/emulparams/elf32lppc.sh index edffc61..bc9125d 100644 --- a/contrib/binutils/ld/emulparams/elf32lppc.sh +++ b/contrib/binutils/ld/emulparams/elf32lppc.sh @@ -1,8 +1,18 @@ TEMPLATE_NAME=elf32 +# If you change this, please also look at: +# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh GENERATE_SHLIB_SCRIPT=yes -SCRIPT_NAME=elfppc +SCRIPT_NAME=elf OUTPUT_FORMAT="elf32-powerpcle" -TEXT_START_ADDR=0x40000 -MAXPAGESIZE=0x40000 +TEXT_START_ADDR=0x01800000 +MAXPAGESIZE=0x10000 ARCH=powerpc MACHINE= +BSS_PLT= +EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' +OTHER_BSS_END_SYMBOLS='__end = .;' +OTHER_READWRITE_SECTIONS=' + .fixup : { *(.fixup) } + .got1 : { *(.got1) } + .got2 : { *(.got2) } +' diff --git a/contrib/binutils/ld/emulparams/elf32lppcsim.sh b/contrib/binutils/ld/emulparams/elf32lppcsim.sh new file mode 100644 index 0000000..74959f8 --- /dev/null +++ b/contrib/binutils/ld/emulparams/elf32lppcsim.sh @@ -0,0 +1,18 @@ +TEMPLATE_NAME=elf32 +# If you change this, please also look at: +# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh +GENERATE_SHLIB_SCRIPT=yes +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-powerpcle" +TEXT_START_ADDR=0x10000000 +MAXPAGESIZE=0x10000 +ARCH=powerpc +MACHINE= +BSS_PLT= +EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' +OTHER_BSS_END_SYMBOLS='__end = .;' +OTHER_READWRITE_SECTIONS=' + .fixup : { *(.fixup) } + .got1 : { *(.got1) } + .got2 : { *(.got2) } +' diff --git a/contrib/binutils/ld/emulparams/elf32ppc.sh b/contrib/binutils/ld/emulparams/elf32ppc.sh index 3e3880c..2220810 100644 --- a/contrib/binutils/ld/emulparams/elf32ppc.sh +++ b/contrib/binutils/ld/emulparams/elf32ppc.sh @@ -1,8 +1,18 @@ TEMPLATE_NAME=elf32 +# If you change this, please also look at: +# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh GENERATE_SHLIB_SCRIPT=yes -SCRIPT_NAME=elfppc +SCRIPT_NAME=elf OUTPUT_FORMAT="elf32-powerpc" TEXT_START_ADDR=0x01800000 MAXPAGESIZE=0x10000 ARCH=powerpc MACHINE= +BSS_PLT= +EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' +OTHER_BSS_END_SYMBOLS='__end = .;' +OTHER_READWRITE_SECTIONS=' + .fixup : { *(.fixup) } + .got1 : { *(.got1) } + .got2 : { *(.got2) } +' diff --git a/contrib/binutils/ld/emulparams/elf32ppclinux.sh b/contrib/binutils/ld/emulparams/elf32ppclinux.sh index 9996c7b..7c458a2 100644 --- a/contrib/binutils/ld/emulparams/elf32ppclinux.sh +++ b/contrib/binutils/ld/emulparams/elf32ppclinux.sh @@ -1,8 +1,18 @@ TEMPLATE_NAME=elf32 +# If you change this, please also look at: +# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh GENERATE_SHLIB_SCRIPT=yes -SCRIPT_NAME=elfppc +SCRIPT_NAME=elf OUTPUT_FORMAT="elf32-powerpc" TEXT_START_ADDR=0x10000000 MAXPAGESIZE=0x10000 ARCH=powerpc MACHINE= +BSS_PLT= +OTHER_RELOCATING_SECTIONS=' + /DISCARD/ : { *(.fixup) } +' +OTHER_READWRITE_SECTIONS=' + .got1 : { *(.got1) } + .got2 : { *(.got2) } +' diff --git a/contrib/binutils/ld/emulparams/elf32ppcsim.sh b/contrib/binutils/ld/emulparams/elf32ppcsim.sh new file mode 100644 index 0000000..e25a170 --- /dev/null +++ b/contrib/binutils/ld/emulparams/elf32ppcsim.sh @@ -0,0 +1,18 @@ +TEMPLATE_NAME=elf32 +# If you change this, please also look at: +# elf32ppc.sh elf32ppcsim.sh elf32lppc.sh elf32lppcsim.sh elf32ppclinux.sh +GENERATE_SHLIB_SCRIPT=yes +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-powerpc" +TEXT_START_ADDR=0x10000000 +MAXPAGESIZE=0x10000 +ARCH=powerpc +MACHINE= +BSS_PLT= +EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);' +OTHER_BSS_END_SYMBOLS='__end = .;' +OTHER_READWRITE_SECTIONS=' + .fixup : { *(.fixup) } + .got1 : { *(.got1) } + .got2 : { *(.got2) } +' diff --git a/contrib/binutils/ld/emulparams/elf64_sparc.sh b/contrib/binutils/ld/emulparams/elf64_sparc.sh index 2ab2e4f..b0a58ea 100644 --- a/contrib/binutils/ld/emulparams/elf64_sparc.sh +++ b/contrib/binutils/ld/emulparams/elf64_sparc.sh @@ -2,15 +2,24 @@ SCRIPT_NAME=elf ELFSIZE=64 TEMPLATE_NAME=elf32 OUTPUT_FORMAT="elf64-sparc" -TEXT_START_ADDR=0x100000 MAXPAGESIZE=0x100000 -NONPAGED_TEXT_START_ADDR=0x100000 ARCH="sparc:v9" MACHINE= DATA_PLT= GENERATE_SHLIB_SCRIPT=yes NOP=0x01000000 +case "$target" in + sparc*-solaris*) + TEXT_START_ADDR=0x100000000 + NONPAGED_TEXT_START_ADDR=0x100000000 + ;; + *) + TEXT_START_ADDR=0x100000 + NONPAGED_TEXT_START_ADDR=0x100000 + ;; +esac + if [ "x${host}" = "x${target}" ]; then case " $EMULATION_LIBPATH " in *" ${EMULATION_NAME} "*) @@ -31,7 +40,7 @@ if [ "x${host}" = "x${target}" ]; then LIB_PATH=/lib${suffix}:/lib LIB_PATH=${LIB_PATH}:/usr/lib${suffix}:/usr/lib if [ -n "${NATIVE_LIB_DIRS}" ]; then - LIB_PATH=${LIB_PATH}:`echo ${NATIVE_LIB_DIRS} | sed s/:/${suffix}:/g`${suffix}:${NATIVE_LIB_DIRS} + LIB_PATH=${LIB_PATH}:`echo ${NATIVE_LIB_DIRS} | sed s_:_${suffix}:_g`${suffix}:${NATIVE_LIB_DIRS} fi if [ "${libdir}" != /usr/lib ]; then LIB_PATH=${LIB_PATH}:${libdir}${suffix}:${libdir} diff --git a/contrib/binutils/ld/emulparams/elf64alpha.sh b/contrib/binutils/ld/emulparams/elf64alpha.sh index afa21f2..5c69816 100644 --- a/contrib/binutils/ld/emulparams/elf64alpha.sh +++ b/contrib/binutils/ld/emulparams/elf64alpha.sh @@ -1,10 +1,10 @@ -ENTRY=__start +ENTRY=_start SCRIPT_NAME=elf ELFSIZE=64 TEMPLATE_NAME=elf32 OUTPUT_FORMAT="elf64-alpha" TEXT_START_ADDR="0x120000000" -MAXPAGESIZE=0x100000 +MAXPAGESIZE=0x10000 NONPAGED_TEXT_START_ADDR="0x120000000" ARCH=alpha MACHINE= @@ -13,3 +13,54 @@ DATA_PLT= NOP=0x47ff041f OTHER_READONLY_SECTIONS='.reginfo : { *(.reginfo) }' + +# This code gets inserted into the generic elf32.sc linker script +# and allows us to define our own command line switches. +PARSE_AND_LIST_PROLOGUE=' +#define OPTION_TASO 300 +/* Set the start address as in the Tru64 ld */ +#define ALPHA_TEXT_START_32BIT 0x12000000 + +static int elf64alpha_32bit = 0; + +struct ld_emulation_xfer_struct ld_elf64alpha_emulation; +static void gld_elf64alpha_finish (); +' + +PARSE_AND_LIST_LONGOPTS=' + {"taso", no_argument, NULL, OPTION_TASO}, +' + +PARSE_AND_LIST_OPTIONS=' + fprintf (file, _(" -taso\t\t\tLoad executable in the lower 31-bit addressable\n")); + fprintf (file, _("\t\t\t virtual address range\n")); +' + +PARSE_AND_LIST_ARGS_CASES=' + case EOF: + if (elf64alpha_32bit && !link_info.shared && !link_info.relocateable) + { + lang_section_start (".interp", + exp_binop ('\''+'\'', + exp_intop (ALPHA_TEXT_START_32BIT), + exp_nameop (SIZEOF_HEADERS, NULL))); + ld_elf64alpha_emulation.finish = gld_elf64alpha_finish; + } + return 0; + + case OPTION_TASO: + elf64alpha_32bit = 1; + break; +' + +PARSE_AND_LIST_EPILOGUE=' +#include "elf/internal.h" +#include "elf/alpha.h" +#include "elf-bfd.h" + +static void +gld_elf64alpha_finish() +{ + elf_elfheader (output_bfd)->e_flags |= EF_ALPHA_32BIT; +} +' diff --git a/contrib/binutils/ld/emulparams/elf_i386_chaos.sh b/contrib/binutils/ld/emulparams/elf_i386_chaos.sh new file mode 100644 index 0000000..32e7719 --- /dev/null +++ b/contrib/binutils/ld/emulparams/elf_i386_chaos.sh @@ -0,0 +1,10 @@ +SCRIPT_NAME=elf +OUTPUT_FORMAT="elf32-i386" +TEXT_START_ADDR=0x40000000 +MAXPAGESIZE=0x1000 +NONPAGED_TEXT_START_ADDR=0x40000000 +ARCH=i386 +MACHINE= +NOP=0x9090 +TEMPLATE_NAME=elf32 +GENERATE_SHLIB_SCRIPT=yes |