This fixes: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67871

2015-10-20  Jonathan Roelofs  <jonat...@codesourcery.com>

        * config/arm/bpabi.h: Tell the linker which emulation to use
        based on the endianness of the target.


2015-10-20  Jonathan Roelofs  <jonat...@codesourcery.com>

        * ld/configure.tgt: Support big-endian emulation in
        arm*-*-eabi* configs.


OK to commit?

--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
Index: ld/configure.tgt
===================================================================
--- ld/configure.tgt    (revision 455328)
+++ ld/configure.tgt    (working copy)
@@ -99,8 +99,11 @@
 arm-*-rtems*)          targ_emul=armelf ;;
 armeb-*-elf | armeb-*-eabi*)
                        targ_emul=armelfb ;;
-arm-*-elf | arm*-*-eabi*)
+arm-*-elf)
                        targ_emul=armelf ;;
+arm*-*-eabi*)
+                       targ_emul=armelf
+                       targ_extra_emuls="armelf armelfb"  ;;
 arm*-*-nucleuseabi)     targ_emul=armelf ;;
 arm*-*-symbianelf*)     targ_emul=armsymbian;;
 arm-*-kaos*)           targ_emul=armelf ;;
Index: ld/ChangeLog
===================================================================
--- ld/ChangeLog        (revision 455328)
+++ ld/ChangeLog        (working copy)
@@ -1,3 +1,8 @@
+2015-10-20  Jonathan Roelofs  <jonat...@codesourcery.com>
+
+       * ld/configure.tgt: Support big-endian emulation in
+       arm*-*-eabi* configs.
+
 2015-08-19  Alan Modra  <amo...@gmail.com>
 
        * emultempl/aix.em: Don't set link_info.pic.
Index: gcc/config/arm/bpabi.h
===================================================================
--- gcc/config/arm/bpabi.h      (revision 455328)
+++ gcc/config/arm/bpabi.h      (working copy)
@@ -128,7 +128,7 @@
 
 /* The generic link spec in elf.h does not support shared libraries.  */
 #define BPABI_LINK_SPEC \
-  "%{mbig-endian:-EB} %{mlittle-endian:-EL} "          \
+  "%{mbig-endian:-EB -m armelfb} %{mlittle-endian:-EL -m armelf} "     \
   "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "       \
   "-X" SUBTARGET_EXTRA_LINK_SPEC EABI_LINK_SPEC
 
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog       (revision 455328)
+++ gcc/ChangeLog       (working copy)
@@ -1,3 +1,8 @@
+2015-10-20  Jonathan Roelofs  <jonat...@codesourcery.com>
+
+       * config/arm/bpabi.h: Tell the linker which emulation to use
+       based on the endianness of the target.
+
 2015-07-16  Release Manager
 
        * GCC 5.2.0 released.

Reply via email to