2014-03-12 Aldy Hernandez <aldyh@redhat.com>
Import from upstream binutils-2_24-branch:
bfd/
* config.bfd: Add powerpc64le-linux.
gas/
* configure.in: Allow little-endian linux.
* configure: Regenerate.
gold/
* configure.tgt: Add powerpcle and powerpc64le.
ld/
* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32lppclinux.c.
(eelf32lppclinux.c): New rule.
* Makefile.in: Regenerate.
* configure.tgt: Merge powerpc-linux and other powerpc-elf targets
with corresponding little-endian targets.
* emulparams/elf32lppc.sh: Update comment.
* emulparams/elf32lppclinux.sh: New.
Also, copy over the corresponding test changes:
testsuite/ld-powerpc/export-class.exp
testsuite/ld-powerpc/powerpc-64-export-class.xd
diff --git a/bfd/config.bfd b/bfd/config.bfd
index ab9c705..d99e876 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -1242,7 +1242,8 @@ case "${targ}" in
targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec aix5coff64_vec"
want64=true
;;
- powerpc64le-*-elf* | powerpcle-*-elf64*)
+ powerpc64le-*-elf* | powerpcle-*-elf64* | powerpc64le-*-linux* | \
+ powerpc64le-*-*bsd*)
targ_defvec=bfd_elf64_powerpcle_vec
targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpcle_vec bfd_elf32_powerpc_vec rs6000coff_vec rs6000coff64_vec aix5coff64_vec"
want64=true
diff --git a/gas/configure b/gas/configure
index 05686dc..6413725 100755
--- a/gas/configure
+++ b/gas/configure
@@ -12011,12 +12011,6 @@ $as_echo "$as_me: WARNING: GAS support for ${generic_target} is preliminary and
$as_echo "#define AIX_WEAK_SUPPORT 1" >>confdefs.h
;;
- ppc-*-linux-*)
- case "$endian" in
- big) ;;
- *) as_fn_error "GNU/Linux must be configured big endian" "$LINENO" 5 ;;
- esac
- ;;
ppc-*-solaris*)
if test ${this_target} = $target; then
diff --git a/gas/configure.in b/gas/configure.in
index 88cbff8..37f6d5f 100644
--- a/gas/configure.in
+++ b/gas/configure.in
@@ -176,12 +176,6 @@ changequote([,])dnl
AC_DEFINE(AIX_WEAK_SUPPORT, 1,
[Define if using AIX 5.2 value for C_WEAKEXT.])
;;
- ppc-*-linux-*)
- case "$endian" in
- big) ;;
- *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
- esac
- ;;
ppc-*-solaris*)
if test ${this_target} = $target; then
AC_DEFINE(TARGET_SOLARIS_COMMENT, 1,
diff --git a/gold/configure.tgt b/gold/configure.tgt
index 504de2f..d61647e 100644
--- a/gold/configure.tgt
+++ b/gold/configure.tgt
@@ -104,6 +104,14 @@ powerpc-*)
targ_big_endian=true
targ_extra_big_endian=false
;;
+powerpcle-*)
+ targ_obj=powerpc
+ targ_machine=EM_PPC
+ targ_size=32
+ targ_extra_size=64
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
powerpc64-*)
targ_obj=powerpc
targ_machine=EM_PPC64
@@ -112,6 +120,14 @@ powerpc64-*)
targ_big_endian=true
targ_extra_big_endian=false
;;
+powerpc64le-*)
+ targ_obj=powerpc
+ targ_machine=EM_PPC64
+ targ_size=64
+ targ_extra_size=32
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
armeb*-*-*|armbe*-*-*)
targ_obj=arm
targ_extra_obj=arm-reloc-property
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 10340e8..1bbcf70 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -248,6 +248,7 @@ ALL_EMULATION_SOURCES = \
eelf32lm32fd.c \
eelf32lmip.c \
eelf32lppc.c \
+ eelf32lppclinux.c \
eelf32lppcnto.c \
eelf32lppcsim.c \
eelf32lsmip.c \
@@ -1107,6 +1108,12 @@ eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
ldemul-list.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
+eelf32lppclinux.c: $(srcdir)/emulparams/elf32lppclinux.sh \
+ $(srcdir)/emulparams/elf32lppc.sh $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \
+ ldemul-list.h \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lppclinux "$(tdir_elf32lppclinux)"
eelf32lppcnto.c: $(srcdir)/emulparams/elf32lppcnto.sh \
$(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
$(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 52fb9d6..449845d 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -555,6 +555,7 @@ ALL_EMULATION_SOURCES = \
eelf32lm32fd.c \
eelf32lmip.c \
eelf32lppc.c \
+ eelf32lppclinux.c \
eelf32lppcnto.c \
eelf32lppcsim.c \
eelf32lsmip.c \
@@ -1188,6 +1189,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lm32fd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lmip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppclinux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppcnto.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppcsim.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lr5900.Po@am__quote@
@@ -2591,6 +2593,12 @@ eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
ldemul-list.h \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
+eelf32lppclinux.c: $(srcdir)/emulparams/elf32lppclinux.sh \
+ $(srcdir)/emulparams/elf32lppc.sh $(srcdir)/emulparams/elf32ppc.sh \
+ $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \
+ ldemul-list.h \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32lppclinux "$(tdir_elf32lppclinux)"
eelf32lppcnto.c: $(srcdir)/emulparams/elf32lppcnto.sh \
$(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \
$(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \
diff --git a/ld/configure.tgt b/ld/configure.tgt
index bc92a20..dbc50a3 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -541,56 +541,44 @@ powerpc64-*-freebsd*)
tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
tdir_elf32ppc_fbsd=$tdir_elf32ppc
;;
-powerpc*-*-linux*) case "${targ}" in
+powerpc-*-vxworks*)
+ targ_emul=elf32ppcvxworks
+ targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" ;;
+powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
+ | powerpc*-*-linux* | powerpc*-*-netbsd* | powerpc*-*-openbsd* \
+ | powerpc*-*-solaris* | powerpc*-*-kaos* | powerpc*-*-vxworks*)
+ case "${targ}" in
*64*) targ_emul=elf64ppc
- targ_extra_emuls="elf32ppclinux elf32ppc elf32ppcsim"
- targ_extra_libpath="elf32ppclinux elf32ppc"
- tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
- tdir_elf32ppclinux=$tdir_elf32ppc
- tdir_elf32ppcsim=$tdir_elf32ppc
+ targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
+ targ_extra_libpath="elf32ppc elf32ppclinux"
+ td=tdir_elf32ppc
+ case "${targ}" in
+ powerpc*le-*) td=tdir_elf32lppc;;
+ esac
+ eval ${td}=`echo "${targ_alias}" | sed -e 's/64//'`
+ eval ${td}linux=\$${td}
+ eval ${td}sim=\$${td}
;;
- *) targ_emul=elf32ppclinux
+ *linux*) targ_emul=elf32ppclinux
targ_extra_emuls="elf32ppc elf32ppcsim"
targ_extra_libpath=elf32ppc
targ64_extra_emuls=elf64ppc
targ64_extra_libpath=elf64ppc
;;
- esac ;;
-powerpc*le-*-elf* | powerpc*le-*-eabi* | powerpc*le-*-solaris* \
- | powerpc*le-*-sysv* | powerpc*le-*-vxworks*)
- case "${targ}" in
- *64*) targ_emul=elf64lppc
- targ_extra_emuls="elf32lppc elf32lppcsim"
- targ_extra_libpath=elf32lppc
- tdir_elf32lppc=`echo "${targ_alias}" | sed -e 's/64//'`
- tdir_elf32lppcsim=$tdir_elf32lppc
- ;;
- *) targ_emul=elf32lppc
- targ_extra_emuls=elf32lppcsim
- targ64_extra_emuls=elf64lppc
- targ64_extra_libpath=elf64lppc
- ;;
- esac ;;
-powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
- | powerpc*-*-netbsd* | powerpc-*-openbsd* | powerpc*-*-kaos*)
- case "${targ}" in
- *64*) targ_emul=elf64ppc
- targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
- targ_extra_libpath="elf32ppc elf32ppclinux"
- tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
- tdir_elf32ppclinux=$tdir_elf32ppc
- tdir_elf32ppcsim=$tdir_elf32ppc
- ;;
*) targ_emul=elf32ppc
targ_extra_emuls="elf32ppclinux elf32ppcsim"
targ_extra_libpath=elf32ppclinux
targ64_extra_emuls=elf64ppc
targ64_extra_libpath=elf64ppc
;;
+ esac
+ case "${targ}" in
+ powerpc*le-*)
+ for z in targ_emul targ_extra_emuls targ_extra_libpath targ64_extra_emuls targ64_extra_libpath
+ do
+ eval ${z}=\"`eval echo \\$${z} | sed -e 's/ppc/lppc/g'`\"
+ done
esac ;;
-powerpc-*-vxworks*)
- targ_emul=elf32ppcvxworks
- targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" ;;
powerpc-*-nto*) targ_emul=elf32ppcnto ;;
powerpcle-*-nto*) targ_emul=elf32lppcnto ;;
powerpc-*-rtems*) targ_emul=elf32ppc ;;
diff --git a/ld/emulparams/elf32lppc.sh b/ld/emulparams/elf32lppc.sh
index 18cce48..8d4e3a0 100644
--- a/ld/emulparams/elf32lppc.sh
+++ b/ld/emulparams/elf32lppc.sh
@@ -1,5 +1,5 @@
# If you change this file, please also look at files which source this one:
-# elf32lppcsim.sh
+# elf32lppcsim.sh elf32lppclinux.sh
. ${srcdir}/emulparams/elf32ppc.sh
OUTPUT_FORMAT="elf32-powerpcle"
diff --git a/ld/emulparams/elf32lppclinux.sh b/ld/emulparams/elf32lppclinux.sh
new file mode 100644
index 0000000..9a56372
--- /dev/null
+++ b/ld/emulparams/elf32lppclinux.sh
@@ -0,0 +1,8 @@
+. ${srcdir}/emulparams/elf32lppc.sh
+TEXT_START_ADDR=0x10000000
+unset EXECUTABLE_SYMBOLS
+unset OTHER_END_SYMBOLS
+test -z "${RELOCATING}" || OTHER_SECTIONS="/DISCARD/ : { *(.fixup) }"
+OTHER_RELRO_SECTIONS="
+ .got1 ${RELOCATING-0} : { *(.got1) }
+ .got2 ${RELOCATING-0} : { *(.got2) }"
diff --git a/ld/testsuite/ld-powerpc/export-class.exp b/ld/testsuite/ld-powerpc/export-class.exp
index 5b721fc..6171d13 100644
--- a/ld/testsuite/ld-powerpc/export-class.exp
+++ b/ld/testsuite/ld-powerpc/export-class.exp
@@ -30,22 +30,11 @@ if { ![istarget powerpc*-*-linux*] } {
return
}
-proc supports_ppc64 { } {
- global ld
+proc powerpc_export_class_test { abi endian emul } {
- catch "exec $ld --help | grep emulations" tmp
- if [string match "*elf64ppc*" $tmp] then {
- return 1
- } else {
- return 0
- }
-}
-
-proc powerpc_export_class_test { abi emul } {
-
- set testname "PowerPC $abi symbol export class test"
+ set testname "PowerPC $abi $endian symbol export class test"
- set AFLAGS "-a$abi -be"
+ set AFLAGS "-a$abi -$endian"
set LDFLAGS "-m$emul"
# Build an auxiliary shared object with conflicting versioned symbol
@@ -96,11 +85,13 @@ proc powerpc_export_class_test { abi emul } {
]
}
-if { [supports_ppc64] } {
- set abis { 32 elf32ppclinux 64 elf64ppc }
-} else {
- set abis { 32 elf32ppclinux }
-}
-foreach { abi emul } $abis {
- powerpc_export_class_test $abi $emul
+set abis { 32 be elf32ppclinux 32 le elf32lppclinux 64 be elf64ppc 64 le elf64lppc }
+
+global ld
+catch "exec $ld --help | grep emulations" ldemul
+
+foreach { abi endian emul } $abis {
+ if { [string first $emul $ldemul] != -1 } then {
+ powerpc_export_class_test $abi $endian $emul
+ }
}
diff --git a/ld/testsuite/ld-powerpc/powerpc-64-export-class.xd b/ld/testsuite/ld-powerpc/powerpc-64-export-class.xd
index d0388ad..264803c 100644
--- a/ld/testsuite/ld-powerpc/powerpc-64-export-class.xd
+++ b/ld/testsuite/ld-powerpc/powerpc-64-export-class.xd
@@ -1,11 +1,11 @@
Hex dump of section '\.data':
- 0x12340000 00000000 123400a0 00000000 00000000 .*
- 0x12340010 00000000 123400a0 00000000 00000000 .*
- 0x12340020 00000000 123400a0 00000000 00000000 .*
- 0x12340030 00000000 00000000 00000000 00000000 .*
- 0x12340040 00000000 123400a0 00000000 00000000 .*
- 0x12340050 00000000 123400a0 00000000 00000000 .*
- 0x12340060 00000000 123400a0 00000000 00000000 .*
- 0x12340070 00000000 123400a0 00000000 00000000 .*
- 0x12340080 00000000 123400a0 00000000 00000000 .*
- 0x12340090 00000000 123400a0 00000000 00000000 .*
+ 0x12340000 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*
+ 0x12340010 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*
+ 0x12340020 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*
+ 0x12340030 (00000000|00000000) (00000000|00000000) 00000000 00000000 .*
+ 0x12340040 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*
+ 0x12340050 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*
+ 0x12340060 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*
+ 0x12340070 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*
+ 0x12340080 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*
+ 0x12340090 (00000000|a0003412) (123400a0|00000000) 00000000 00000000 .*