diff options
author | Richard Henderson <rth@redhat.com> | 2002-10-15 17:14:51 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 2002-10-15 17:14:51 +0000 |
commit | 2238051fb35d6a72a5892f9025c491f334d8c0da (patch) | |
tree | 2652088a9d46e399ab2f48512598dad350476bd4 /bfd/elf64-alpha.c | |
parent | 48417c1accc44a505e6bdd5d205a7960e3756064 (diff) | |
download | binutils-gdb-2238051fb35d6a72a5892f9025c491f334d8c0da.tar.gz |
* Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd.
(BFD64_BACKENDS_CFILES): Likewise.
* configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha.
* elf64-alpha-fbsd.c: Remove file, move code ...
* elf64-alpha.c: ... here.
* Makefile.in, configure: Rebuild.
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r-- | bfd/elf64-alpha.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 1058a1c269e..2eb5d104301 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -5510,13 +5510,11 @@ static const struct elf_size_info alpha_elf_size_info = NULL }; -#ifndef ELF_ARCH #define TARGET_LITTLE_SYM bfd_elf64_alpha_vec #define TARGET_LITTLE_NAME "elf64-alpha" #define ELF_ARCH bfd_arch_alpha #define ELF_MACHINE_CODE EM_ALPHA #define ELF_MAXPAGESIZE 0x10000 -#endif /* ELF_ARCH */ #define bfd_elf64_bfd_link_hash_table_create \ elf64_alpha_bfd_link_hash_table_create @@ -5582,3 +5580,42 @@ static const struct elf_size_info alpha_elf_size_info = #define elf_backend_plt_header_size PLT_HEADER_SIZE #include "elf64-target.h" + +/* FreeBSD support. */ + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf64_alpha_freebsd_vec +#undef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "elf64-alpha-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_alpha_fbsd_post_process_headers + PARAMS ((bfd *, struct bfd_link_info *)); + +static void +elf64_alpha_fbsd_post_process_headers (abfd, link_info) + 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; +#ifdef OLD_FREEBSD_ABI_LABEL + /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ + memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); +#endif +} + +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers \ + elf64_alpha_fbsd_post_process_headers + +#define elf64_bed elf64_alpha_fbsd_bed + +#include "elf64-target.h" |