summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/ld/emulparams
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-12-02 09:06:04 +0000
committerobrien <obrien@FreeBSD.org>2002-12-02 09:06:04 +0000
commit4f4b0b5073010ff850cc95a6bd074066eeb7dccb (patch)
treeb6de1df6076881154726637e90c9d9bae94bab79 /contrib/binutils/ld/emulparams
parent70d0c6024ff722929b55e70683c5bb4bd3d3b07f (diff)
downloadFreeBSD-src-4f4b0b5073010ff850cc95a6bd074066eeb7dccb.zip
FreeBSD-src-4f4b0b5073010ff850cc95a6bd074066eeb7dccb.tar.gz
Import of Binutils from the FSF 2.13 branch (just pre-.2 release).
These bits are taken from the FSF anoncvs repo on 27-Oct-2002 21:12:00 EST.
Diffstat (limited to 'contrib/binutils/ld/emulparams')
-rw-r--r--contrib/binutils/ld/emulparams/elf32ppc.sh4
-rw-r--r--contrib/binutils/ld/emulparams/elf64_s390.sh30
-rw-r--r--contrib/binutils/ld/emulparams/elf64_sparc.sh45
-rw-r--r--contrib/binutils/ld/emulparams/elf64ppc.sh2
-rw-r--r--contrib/binutils/ld/emulparams/elf_x86_64.sh35
-rwxr-xr-xcontrib/binutils/ld/emulparams/shelf.sh14
6 files changed, 87 insertions, 43 deletions
diff --git a/contrib/binutils/ld/emulparams/elf32ppc.sh b/contrib/binutils/ld/emulparams/elf32ppc.sh
index f88198f..778260b 100644
--- a/contrib/binutils/ld/emulparams/elf32ppc.sh
+++ b/contrib/binutils/ld/emulparams/elf32ppc.sh
@@ -17,6 +17,10 @@ OTHER_READWRITE_SECTIONS="
.got1 ${RELOCATING-0} : { *(.got1) }
.got2 ${RELOCATING-0} : { *(.got2) }
"
+OTHER_GOT_RELOC_SECTIONS="
+ .rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
+ .rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
+"
# Treat a host that matches the target with the possible exception of "64"
# in the name as if it were native.
diff --git a/contrib/binutils/ld/emulparams/elf64_s390.sh b/contrib/binutils/ld/emulparams/elf64_s390.sh
index 8416c89..236fd17 100644
--- a/contrib/binutils/ld/emulparams/elf64_s390.sh
+++ b/contrib/binutils/ld/emulparams/elf64_s390.sh
@@ -9,3 +9,33 @@ MACHINE=
NOP=0x07070707
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+
+# Treat a host that matches the target with the possible exception of "x"
+# in the name as if it were native.
+if test `echo "$host" | sed -e s/390x/390/` \
+ = `echo "$target" | sed -e s/390x/390/`; then
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ LIB_PATH=${libdir}
+ for lib in ${NATIVE_LIB_DIRS}; do
+ case :${LIB_PATH}: in
+ *:${lib}:*) ;;
+ *) LIB_PATH=${LIB_PATH}:${lib} ;;
+ esac
+ done
+
+ case "$target" in
+ s390*-linux*)
+ suffix=64 ;;
+ esac
+
+ # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
+ # on Linux.
+ if [ -n "$suffix" ]; then
+ case "$EMULATION_NAME" in
+ *64*)
+ LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,$suffix:,g`$LIB_PATH ;;
+ esac
+ fi ;;
+ esac
+fi
diff --git a/contrib/binutils/ld/emulparams/elf64_sparc.sh b/contrib/binutils/ld/emulparams/elf64_sparc.sh
index a4706b5..7a4d2dc 100644
--- a/contrib/binutils/ld/emulparams/elf64_sparc.sh
+++ b/contrib/binutils/ld/emulparams/elf64_sparc.sh
@@ -22,36 +22,37 @@ case "$target" in
;;
esac
-if [ "x${host}" = "x${target}" ]; then
+# Treat a host that matches the target with the possible exception of "64"
+# and "v7", "v8", "v9" in the name as if it were native.
+if test `echo "$host" | sed -e 's/64//;s/v[789]//'` \
+ = `echo "$target" | sed -e 's/64//;s/v[789]//'`; then
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
- # Native, and default or emulation requesting LIB_PATH.
+ LIB_PATH=${libdir}
+ for lib in ${NATIVE_LIB_DIRS}; do
+ case :${LIB_PATH}: in
+ *:${lib}:*) ;;
+ *) LIB_PATH=${LIB_PATH}:${lib} ;;
+ esac
+ done
# Linux and Solaris modify the default library search path
# to first include a 64-bit specific directory. It's put
# in slightly different places on the two systems.
case "$target" in
- sparc*-linux*)
- suffix=64 ;;
- sparc*-solaris*)
- suffix=/sparcv9 ;;
+ sparc*-linux*)
+ suffix=64 ;;
+ sparc*-solaris*)
+ suffix=/sparcv9 ;;
esac
- if [ -n "${suffix}" ]; 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}
- fi
- if [ "${libdir}" != /usr/lib ]; then
- LIB_PATH=${LIB_PATH}:${libdir}${suffix}:${libdir}
- fi
- if [ "${libdir}" != /usr/local/lib ]; then
- LIB_PATH=${LIB_PATH}:/usr/local/lib${suffix}:/usr/local/lib
- fi
-
- fi
- ;;
+ # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first
+ # on Linux and /lib/sparcv9, /usr/lib/sparcv9 etc. on Solaris.
+ if [ -n "$suffix" ]; then
+ case "$EMULATION_NAME" in
+ *64*)
+ LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,$suffix:,g`$LIB_PATH ;;
+ esac
+ fi ;;
esac
fi
diff --git a/contrib/binutils/ld/emulparams/elf64ppc.sh b/contrib/binutils/ld/emulparams/elf64ppc.sh
index e3a8177..add6c54 100644
--- a/contrib/binutils/ld/emulparams/elf64ppc.sh
+++ b/contrib/binutils/ld/emulparams/elf64ppc.sh
@@ -5,7 +5,7 @@ GENERATE_SHLIB_SCRIPT=yes
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf64-powerpc"
TEXT_START_ADDR=0x10000000
-DATA_ADDR="ALIGN (0x10000000) + (. & (${MAXPAGESIZE} - 1))"
+#DATA_ADDR="ALIGN (0x10000000) + (. & (${MAXPAGESIZE} - 1))"
MAXPAGESIZE=0x10000
COMMONPAGESIZE=0x1000
ARCH=powerpc:common64
diff --git a/contrib/binutils/ld/emulparams/elf_x86_64.sh b/contrib/binutils/ld/emulparams/elf_x86_64.sh
index 1786e33..a428bfc 100644
--- a/contrib/binutils/ld/emulparams/elf_x86_64.sh
+++ b/contrib/binutils/ld/emulparams/elf_x86_64.sh
@@ -15,30 +15,27 @@ NO_SMALL_DATA=yes
if [ "x${host}" = "x${target}" ]; then
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
- # Native, and default or emulation requesting LIB_PATH.
+ LIB_PATH=${libdir}
+ for lib in ${NATIVE_LIB_DIRS}; do
+ case :${LIB_PATH}: in
+ *:${lib}:*) ;;
+ *) LIB_PATH=${LIB_PATH}:${lib} ;;
+ esac
+ done
# Linux modify the default library search path to first include
# a 64-bit specific directory.
case "$target" in
- x86_64*-linux*)
- suffix=64 ;;
+ x86_64*-linux*)
+ suffix=64 ;;
esac
- if [ -n "${suffix}" ]; 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}
- fi
- if [ "${libdir}" != /usr/lib ]; then
- LIB_PATH=${LIB_PATH}:${libdir}${suffix}:${libdir}
- fi
- if [ "${libdir}" != /usr/local/lib ]; then
- LIB_PATH=${LIB_PATH}:/usr/local/lib${suffix}:/usr/local/lib
- fi
-
- fi
- ;;
+ # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
+ if [ -n "$suffix" ]; then
+ case "$EMULATION_NAME" in
+ *64*)
+ LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,$suffix:,g`$LIB_PATH ;;
+ esac
+ fi ;;
esac
fi
diff --git a/contrib/binutils/ld/emulparams/shelf.sh b/contrib/binutils/ld/emulparams/shelf.sh
index 27b73b6..5c0c9d6 100755
--- a/contrib/binutils/ld/emulparams/shelf.sh
+++ b/contrib/binutils/ld/emulparams/shelf.sh
@@ -17,4 +17,16 @@ CTOR_START='___ctors = .;'
CTOR_END='___ctors_end = .;'
DTOR_START='___dtors = .;'
DTOR_END='___dtors_end = .;'
-STACK_ADDR=0x30000
+# This is like setting STACK_ADDR to 0x30000, except that the setting can
+# be overridden, e.g. --defsym _stack=0x0f00, and that we put an extra
+# sentinal value at the bottom.
+# N.B. We can't use PROVIDE to set the default value in a symbol because
+# the address is needed to place the .stack section, which in turn is needed
+# to hold the sentinel value(s).
+OTHER_SECTIONS=" .stack ${RELOCATING-0}${RELOCATING+(DEFINED(_stack) ? _stack : 0x30000)} :
+ {
+ ${RELOCATING+_stack = .;}
+ *(.stack)
+ LONG(0xdeaddead)
+ }"
+
OpenPOWER on IntegriCloud