PR26667, Add powerpc64le-*-freebsd* support
authorBrandon Bergren <bdragon@FreeBSD.org>
Mon, 5 Oct 2020 22:49:23 +0000 (09:19 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 6 Oct 2020 06:39:27 +0000 (17:09 +1030)
PR 26667
bfd/
* config.bfd: Add powerpc64le-*-freebsd*.
* configure.ac: Add powerpc_elf64_fbsd_le_vec.
* elf64-ppc.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define for
freebsd.
* targets.c (powerpc_elf64_fbsd_le_vec): Declare.
(_bfd_target_vector): Add it.
* configure: Regenerate.
ld/
* Makefile.am (ALL_64_EMULATION_SOURCES): Add eelf64lppc_fbsd.c.
Include $(DEPDIR)/eelf64lppc_fbsd.Pc.
* configure.tgt: Add powerpc64le-*-freebsd*.
* emulparams/elf64lppc_fbsd.sh: New file.
* Makefile.in: Regenerate.
* po/BLD-POTFILES.in: Regenerate.

12 files changed:
bfd/ChangeLog
bfd/config.bfd
bfd/configure
bfd/configure.ac
bfd/elf64-ppc.c
bfd/targets.c
ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/configure.tgt
ld/emulparams/elf64lppc_fbsd.sh [new file with mode: 0644]
ld/po/BLD-POTFILES.in

index 1517db98050a77fea07cca137fa5974ed70d1c3d..5121889969fff1464362ce91adb31728c1b42268 100644 (file)
@@ -1,3 +1,13 @@
+2020-10-06  Brandon Bergren  <bdragon@FreeBSD.org>
+
+       * config.bfd: Add powerpc64le-*-freebsd*.
+       * configure.ac: Add powerpc_elf64_fbsd_le_vec.
+       * elf64-ppc.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Define for
+       freebsd.
+       * targets.c (powerpc_elf64_fbsd_le_vec): Declare.
+       (_bfd_target_vector): Add it.
+       * configure: Regenerate.
+
 2020-10-05  Kamil Rytarowski  <n54@gmx.com>
 
        * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.
index e2992a0df2597b35a5d0dcdf52e23db02a945baa..fdc6dbe3dda11ec02b5c68b6d0e7c4d8936ad5a7 100644 (file)
@@ -1085,6 +1085,11 @@ case "${targ}" in
     targ_selvecs="powerpc_elf64_vec powerpc_elf32_vec powerpc_elf32_fbsd_vec powerpc_elf32_le_vec rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
     want64=true
     ;;
+  powerpc64le-*-freebsd*)
+    targ_defvec=powerpc_elf64_fbsd_le_vec
+    targ_selvecs="powerpc_elf64_vec powerpc_elf32_vec powerpc_elf32_fbsd_vec powerpc_elf32_le_vec rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
+    want64=true
+    ;;
   powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \
   powerpc64-*-*bsd*)
     targ_defvec=powerpc_elf64_vec
index a9c4fd93669e77a46c1fdc77939f8fa17925455d..636f338569b102feadb0855779107e53e294efcc 100755 (executable)
@@ -14914,6 +14914,7 @@ do
     powerpc_elf64_vec)          tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
     powerpc_elf64_le_vec)       tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
     powerpc_elf64_fbsd_vec)     tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
+    powerpc_elf64_fbsd_le_vec)  tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
     powerpc_xcoff_vec)          tb="$tb coff-rs6000.lo $xcoff" ;;
     pru_elf32_vec)              tb="$tb elf32-pru.lo elf32.lo $elf" ;;
     riscv_elf32_vec)            tb="$tb elf32-riscv.lo elfxx-riscv.lo elf32.lo $elf" ;;
index f62659acd7fbe3a62bb4ddd9262d468845d4ce30..cecb0fbb7610210d0b8386f01b9e8ed6fb1ebae4 100644 (file)
@@ -620,6 +620,7 @@ do
     powerpc_elf64_vec)          tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
     powerpc_elf64_le_vec)       tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
     powerpc_elf64_fbsd_vec)     tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
+    powerpc_elf64_fbsd_le_vec)  tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
     powerpc_xcoff_vec)          tb="$tb coff-rs6000.lo $xcoff" ;;
     pru_elf32_vec)              tb="$tb elf32-pru.lo elf32.lo $elf" ;;
     riscv_elf32_vec)            tb="$tb elf32-riscv.lo elfxx-riscv.lo elf32.lo $elf" ;;
index 35f3cbef1ef0d71cd489eedd1823ccc28ae9b326..fa0c7f96e7916b2e8e40f7ff6c8fb8ce3910f24b 100644 (file)
@@ -17717,7 +17717,9 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
 /* FreeBSD support */
 
 #undef  TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM powerpc_elf64_fbsd_le_vec
 #undef  TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf64-powerpcle-freebsd"
 
 #undef  TARGET_BIG_SYM
 #define TARGET_BIG_SYM powerpc_elf64_fbsd_vec
index 35492b92bbecc0f8359ee1a2ef872de69cd91724..b18800928c44684a2eb6a0c7babaaa3ecb7a451a 100644 (file)
@@ -838,6 +838,7 @@ extern const bfd_target powerpc_elf32_vxworks_vec;
 extern const bfd_target powerpc_elf64_vec;
 extern const bfd_target powerpc_elf64_le_vec;
 extern const bfd_target powerpc_elf64_fbsd_vec;
+extern const bfd_target powerpc_elf64_fbsd_le_vec;
 extern const bfd_target powerpc_xcoff_vec;
 extern const bfd_target pru_elf32_vec;
 extern const bfd_target riscv_elf32_vec;
@@ -1224,6 +1225,7 @@ static const bfd_target * const _bfd_target_vector[] =
        &powerpc_elf64_vec,
        &powerpc_elf64_le_vec,
        &powerpc_elf64_fbsd_vec,
+       &powerpc_elf64_fbsd_le_vec,
 #endif
 #if 0
        /* This has the same magic number as RS/6000.  */
index c259b09c74a553ad35c993499a7b5cf7090f5395..62937a1b90482a1f4b9ea32c4f338a35507619a2 100644 (file)
@@ -1,3 +1,12 @@
+2020-10-06  Brandon Bergren  <bdragon@FreeBSD.org>
+
+       * Makefile.am (ALL_64_EMULATION_SOURCES): Add eelf64lppc_fbsd.c.
+       Include $(DEPDIR)/eelf64lppc_fbsd.Pc.
+       * configure.tgt: Add powerpc64le-*-freebsd*.
+       * emulparams/elf64lppc_fbsd.sh: New file.
+       * Makefile.in: Regenerate.
+       * po/BLD-POTFILES.in: Regenerate.
+
 2020-10-05  T.K. Chia  <u1049321969@caramail.com>
 
        PR gas/26694
index e5b19203d14bf3a9c98c74812d5dd39cc6d8cfc6..41db0c6016caca18b784c4cb9662138733344497 100644 (file)
@@ -431,6 +431,7 @@ ALL_64_EMULATION_SOURCES = \
        eelf64btsmip_fbsd.c \
        eelf64hppa.c \
        eelf64lppc.c \
+       eelf64lppc_fbsd.c \
        eelf64lriscv.c \
        eelf64lriscv_lp64f.c \
        eelf64lriscv_lp64.c \
@@ -911,6 +912,7 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64btsmip_fbsd.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64hppa.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lppc.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lppc_fbsd.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv_lp64f.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv_lp64.Pc@am__quote@
index 48ecc756906563a8070b6c6a8a6c28652da8a137..712e3f448092e036c7f526fccf74bd077a27f92f 100644 (file)
@@ -915,6 +915,7 @@ ALL_64_EMULATION_SOURCES = \
        eelf64btsmip_fbsd.c \
        eelf64hppa.c \
        eelf64lppc.c \
+       eelf64lppc_fbsd.c \
        eelf64lriscv.c \
        eelf64lriscv_lp64f.c \
        eelf64lriscv_lp64.c \
@@ -1355,6 +1356,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64btsmip_fbsd.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64hppa.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lppc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lppc_fbsd.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv_lp64.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv_lp64f.Po@am__quote@
@@ -2506,6 +2508,7 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64btsmip_fbsd.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64hppa.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lppc.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lppc_fbsd.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv_lp64f.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv_lp64.Pc@am__quote@
index 32f17d24026b91e8a6e7b995708d7ebd9c1f7f06..70359301b5e96504bcc39f42475a258a493fd2d9 100644 (file)
@@ -636,6 +636,10 @@ powerpc64-*-freebsd*)
                        tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'`
                        tdir_elf32ppc_fbsd=$tdir_elf32ppc
                        ;;
+powerpc64le-*-freebsd*)
+                       targ_emul=elf64lppc_fbsd
+                       targ_extra_emuls="elf64lppc"
+                       ;;
 powerpc-*-vxworks*)
                        targ_emul=elf32ppcvxworks
                        targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
diff --git a/ld/emulparams/elf64lppc_fbsd.sh b/ld/emulparams/elf64lppc_fbsd.sh
new file mode 100644 (file)
index 0000000..5e70ab6
--- /dev/null
@@ -0,0 +1,6 @@
+source_sh ${srcdir}/emulparams/elf64lppc.sh
+source_sh ${srcdir}/emulparams/elf_fbsd.sh
+
+OUTPUT_FORMAT="elf64-powerpcle-freebsd"
+DEFAULT_PLT_STATIC_CHAIN=1
+
index a954e775f69ee313720a14eb4ab86ab09a38b8c5..2d6a30f89a49001cd21e244052e5595b45fdf435 100644 (file)
@@ -177,6 +177,7 @@ eelf64btsmip.c
 eelf64btsmip_fbsd.c
 eelf64hppa.c
 eelf64lppc.c
+eelf64lppc_fbsd.c
 eelf64lriscv.c
 eelf64lriscv_lp64.c
 eelf64lriscv_lp64f.c