PR binutils/2983

* bfd/elf64-x86-64.c: Add FreeBSD support.
  (elf64_x86_64_fbsd_post_process_headers): New function.
* bfd/targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec.
* bfd/config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec to the targ_selvecs.
* bfd/configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec.
* bfd/configure: Regenerate.
* gas/config/tc-i386.c (md_parse_option): Treat any target starting with elf64_x86_64 as a viable target for the -64 switch.
  (i386_target_format): For 64-bit ELF flavoured output use ELF_TARGET_FORMAT64.
* gas/config/tc-i386.h (ELF_TARGET_FORMAT64): Define.
* ld/emulparams/elf_x86_64_fbsd.sh (OUTPUT_FORMAT): Define as elf64-x86-64-freebsd.
This commit is contained in:
Nick Clifton 2006-08-02 16:25:14 +00:00
parent c973bc5cd4
commit 9d7cbccda0
11 changed files with 75 additions and 7 deletions

View File

@ -1,3 +1,14 @@
2006-08-02 Petr Salinger <Petr.Salinger@seznam.cz>
PR binutils/2983
* elf64-x86-64.c: Add FreeBSD support.
(elf64_x86_64_fbsd_post_process_headers): New function.
* targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec.
* config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec
to the targ_selvecs.
* configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec.
* configure: Regenerate.
2006-07-26 Andreas Schwab <schwab@suse.de>
* elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set.

View File

@ -564,8 +564,8 @@ case "${targ}" in
want64=true
;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
targ_defvec=bfd_elf64_x86_64_freebsd_vec
targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec"
want64=true
;;
x86_64-*-netbsd* | x86_64-*-openbsd*)

6
bfd/configure vendored
View File

@ -5282,8 +5282,9 @@ INCINTL=
XGETTEXT=
GMSGFMT=
POSUB=
if test -f ../intl/config.intl; then
. ../intl/config.intl
if test -f ../intl/config.intl; then
. ../intl/config.intl
fi
echo "$as_me:$LINENO: checking whether NLS is requested" >&5
echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6
@ -10917,6 +10918,7 @@ do
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;

View File

@ -708,6 +708,7 @@ do
bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
bfd_elf64_x86_64_freebsd_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;

View File

@ -3710,3 +3710,34 @@ static const struct bfd_elf_special_section
elf64_x86_64_hash_symbol
#include "elf64-target.h"
/* FreeBSD support. */
#undef TARGET_LITTLE_SYM
#define TARGET_LITTLE_SYM bfd_elf64_x86_64_freebsd_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-x86-64-freebsd"
/* The kernel recognizes executables as valid only if they carry a
"FreeBSD" label in the ELF header. So we put this label on all
executables and (for simplicity) also all other object files. */
static void
elf64_x86_64_fbsd_post_process_headers (bfd * abfd,
struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
{
Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */
i_ehdrp = elf_elfheader (abfd);
/* Put an ABI label supported by FreeBSD >= 4.1. */
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
}
#undef elf_backend_post_process_headers
#define elf_backend_post_process_headers elf64_x86_64_fbsd_post_process_headers
#undef elf64_bed
#define elf64_bed elf64_x86_64_fbsd_bed
#include "elf64-target.h"

View File

@ -668,6 +668,7 @@ extern const bfd_target bfd_elf64_sh64nbsd_vec;
extern const bfd_target bfd_elf64_sparc_vec;
extern const bfd_target bfd_elf64_tradbigmips_vec;
extern const bfd_target bfd_elf64_tradlittlemips_vec;
extern const bfd_target bfd_elf64_x86_64_freebsd_vec;
extern const bfd_target bfd_elf64_x86_64_vec;
extern const bfd_target bfd_mmo_vec;
extern const bfd_target bfd_powerpc_pe_vec;
@ -984,6 +985,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf64_sparc_vec,
&bfd_elf64_tradbigmips_vec,
&bfd_elf64_tradlittlemips_vec,
&bfd_elf64_x86_64_freebsd_vec,
&bfd_elf64_x86_64_vec,
&bfd_mmo_vec,
#endif

View File

@ -1,3 +1,12 @@
2006-08-02 Petr Salinger <Petr.Salinger@seznam.cz>
PR binutils/2983
* config/tc-i386.c (md_parse_option): Treat any target starting
with elf64_x86_64 as a viable target for the -64 switch.
(i386_target_format): For 64-bit ELF flavoured output use
ELF_TARGET_FORMAT64.
* config/tc-i386.h (ELF_TARGET_FORMAT64): Define.
2006-08-02 Nick Clifton <nickc@redhat.com>
PR gas/2991

View File

@ -5819,7 +5819,7 @@ md_parse_option (int c, char *arg)
list = bfd_target_list ();
for (l = list; *l != NULL; l++)
if (strcmp (*l, "elf64-x86-64") == 0)
if (strncmp (*l, "elf64-x86-64", 12) == 0)
{
default_arch = "x86_64";
break;
@ -5975,7 +5975,7 @@ i386_target_format ()
object_64bit = 1;
use_rela_relocations = 1;
}
return flag_code == CODE_64BIT ? "elf64-x86-64" : ELF_TARGET_FORMAT;
return flag_code == CODE_64BIT ? ELF_TARGET_FORMAT64 : ELF_TARGET_FORMAT;
}
#endif
default:

View File

@ -1,6 +1,6 @@
/* tc-i386.h -- Header file for tc-i386.c
Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005
2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -55,6 +55,7 @@ extern unsigned long i386_mach (void);
#ifdef TE_FreeBSD
#define ELF_TARGET_FORMAT "elf32-i386-freebsd"
#define ELF_TARGET_FORMAT64 "elf64-x86-64-freebsd"
#elif defined (TE_VXWORKS)
#define ELF_TARGET_FORMAT "elf32-i386-vxworks"
#endif
@ -63,6 +64,10 @@ extern unsigned long i386_mach (void);
#define ELF_TARGET_FORMAT "elf32-i386"
#endif
#ifndef ELF_TARGET_FORMAT64
#define ELF_TARGET_FORMAT64 "elf64-x86-64"
#endif
#if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \
|| defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF))
extern const char *i386_target_format PARAMS ((void));

View File

@ -1,3 +1,9 @@
2006-08-02 Petr Salinger <Petr.Salinger@seznam.cz>
PR binutils/2983
* emulparams/elf_x86_64_fbsd.sh (OUTPUT_FORMAT): Define as
elf64-x86-64-freebsd.
2006-08-01 H.J. Lu <hongjiu.lu@intel.com>
* ldlang.c (init_os): Add flags. Replace bfd_make_section with

View File

@ -1,2 +1,3 @@
. ${srcdir}/emulparams/elf_x86_64.sh
. ${srcdir}/emulparams/elf_fbsd.sh
OUTPUT_FORMAT="elf64-x86-64-freebsd"