aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2010-12-05 20:24:22 +0000
committerDimitry Andric <dim@FreeBSD.org>2010-12-05 20:24:22 +0000
commite3c77b8170a95b15e1be610fba8d6617139259a5 (patch)
tree3bb64497d550391aedbb3bf5665e1d3c01a27e5e
parent2006fbc8fec1e18033bf43636293aa46906b89ea (diff)
For ia64, add a proper 'elf64-ia64-freebsd' output format to BFD, so the
ELF branding for FreeBSD is done in the same way as amd64, i386 and sparc. Something similar should probably also be done for arm, mips and powerpc.
Notes
Notes: svn path=/projects/binutils-2.17/; revision=216200
-rw-r--r--contrib/binutils/bfd/elfxx-ia64.c20
-rw-r--r--contrib/binutils/bfd/targets.c1
-rw-r--r--contrib/binutils/gas/config/tc-ia64.c4
-rw-r--r--contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh1
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.ia645
-rw-r--r--sys/boot/ia64/efi/ldscript.ia642
-rw-r--r--sys/boot/ia64/ski/ldscript.ia642
-rw-r--r--sys/conf/ldscript.ia642
8 files changed, 31 insertions, 6 deletions
diff --git a/contrib/binutils/bfd/elfxx-ia64.c b/contrib/binutils/bfd/elfxx-ia64.c
index 68f2010c6192..e7972120deb7 100644
--- a/contrib/binutils/bfd/elfxx-ia64.c
+++ b/contrib/binutils/bfd/elfxx-ia64.c
@@ -5909,6 +5909,26 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
#include "elfNN-target.h"
+/* FreeBSD support. */
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elfNN_ia64_freebsd_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elfNN-ia64-freebsd"
+#undef TARGET_BIG_SYM
+#undef TARGET_BIG_NAME
+
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_FREEBSD
+
+#undef elf_backend_post_process_headers
+#define elf_backend_post_process_headers _bfd_elf_set_osabi
+
+#undef elfNN_bed
+#define elfNN_bed elfNN_ia64_fbsd_bed
+
+#include "elfNN-target.h"
+
/* HPUX-specific vectors. */
#undef TARGET_LITTLE_SYM
diff --git a/contrib/binutils/bfd/targets.c b/contrib/binutils/bfd/targets.c
index 04b52df057c6..71c8f4be2e36 100644
--- a/contrib/binutils/bfd/targets.c
+++ b/contrib/binutils/bfd/targets.c
@@ -594,6 +594,7 @@ extern const bfd_target bfd_elf32_i860_little_vec;
extern const bfd_target bfd_elf32_i860_vec;
extern const bfd_target bfd_elf32_i960_vec;
extern const bfd_target bfd_elf32_ia64_big_vec;
+extern const bfd_target bfd_elf64_ia64_freebsd_vec;
extern const bfd_target bfd_elf32_ia64_hpux_big_vec;
extern const bfd_target bfd_elf32_ip2k_vec;
extern const bfd_target bfd_elf32_iq2000_vec;
diff --git a/contrib/binutils/gas/config/tc-ia64.c b/contrib/binutils/gas/config/tc-ia64.c
index 5ed9ba82ad2e..2279c9945c71 100644
--- a/contrib/binutils/gas/config/tc-ia64.c
+++ b/contrib/binutils/gas/config/tc-ia64.c
@@ -7704,8 +7704,10 @@ ia64_target_format ()
else
{
if (md.flags & EF_IA_64_ABI64)
-#ifdef TE_AIX50
+#if defined(TE_AIX50)
return "elf64-ia64-aix-little";
+#elif defined(TE_FreeBSD)
+ return "elf64-ia64-freebsd";
#else
return "elf64-ia64-little";
#endif
diff --git a/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh b/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
index ab7e78f292a7..a7e2675e920d 100644
--- a/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
+++ b/contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh
@@ -4,3 +4,4 @@ unset DATA_ADDR
unset SMALL_DATA_CTOR
unset SMALL_DATA_DTOR
. ${srcdir}/emulparams/elf_fbsd.sh
+OUTPUT_FORMAT="elf64-ia64-freebsd"
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.ia64 b/gnu/usr.bin/binutils/libbfd/Makefile.ia64
index 22e310c34ae9..2e489bcc62e5 100644
--- a/gnu/usr.bin/binutils/libbfd/Makefile.ia64
+++ b/gnu/usr.bin/binutils/libbfd/Makefile.ia64
@@ -1,6 +1,6 @@
# $FreeBSD$
-DEFAULT_VECTOR= bfd_elf64_ia64_little_vec
+DEFAULT_VECTOR= bfd_elf64_ia64_freebsd_vec
SRCS+= cofflink.c \
cpu-ia64.c \
@@ -18,13 +18,14 @@ SRCS+= cofflink.c \
VECS+= ${DEFAULT_VECTOR} \
bfd_efi_app_ia64_vec \
+ bfd_elf64_ia64_little_vec \
bfd_elf64_ia64_big_vec \
bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec \
bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec
CLEANFILES+= elf64-ia64.c pepigen.c pex64igen.c
-elf64-ia64.c: elf-fbsd-brand.c elfxx-ia64.c
+elf64-ia64.c: elfxx-ia64.c
sed -e s/NN/64/g ${.ALLSRC} > ${.TARGET}
pepigen.c: peXXigen.c
diff --git a/sys/boot/ia64/efi/ldscript.ia64 b/sys/boot/ia64/efi/ldscript.ia64
index 8c3a89156023..c30f3c5d77c3 100644
--- a/sys/boot/ia64/efi/ldscript.ia64
+++ b/sys/boot/ia64/efi/ldscript.ia64
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-OUTPUT_FORMAT("elf64-ia64-little", "elf64-ia64-little", "elf64-ia64-little")
+OUTPUT_FORMAT("elf64-ia64-freebsd", "elf64-ia64-freebsd", "elf64-ia64-freebsd")
OUTPUT_ARCH(ia64)
ENTRY(_start_plabel)
SECTIONS
diff --git a/sys/boot/ia64/ski/ldscript.ia64 b/sys/boot/ia64/ski/ldscript.ia64
index 973b0af6d2f1..4027807344f8 100644
--- a/sys/boot/ia64/ski/ldscript.ia64
+++ b/sys/boot/ia64/ski/ldscript.ia64
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-OUTPUT_FORMAT("elf64-ia64-little", "elf64-ia64-little", "elf64-ia64-little")
+OUTPUT_FORMAT("elf64-ia64-freebsd", "elf64-ia64-freebsd", "elf64-ia64-freebsd")
OUTPUT_ARCH(ia64)
ENTRY(_start)
SECTIONS
diff --git a/sys/conf/ldscript.ia64 b/sys/conf/ldscript.ia64
index 8dc0368c7522..57b17d6d73fe 100644
--- a/sys/conf/ldscript.ia64
+++ b/sys/conf/ldscript.ia64
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-OUTPUT_FORMAT("elf64-ia64-little", "elf64-ia64-little", "elf64-ia64-little")
+OUTPUT_FORMAT("elf64-ia64-freebsd", "elf64-ia64-freebsd", "elf64-ia64-freebsd")
OUTPUT_ARCH(ia64)
ENTRY(__start)
SEARCH_DIR(/usr/lib);