]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/binutils/bfd/elf64-alpha-fbsd.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / binutils / bfd / elf64-alpha-fbsd.c
1 /* Alpha specific support for 64-bit ELF on FreeBSD.
2    Copyright 2002 Free Software Foundation, Inc.
3
4 This file is part of BFD, the Binary File Descriptor library.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19
20 #define TARGET_LITTLE_SYM       bfd_elf64_alpha_freebsd_vec
21 #define TARGET_LITTLE_NAME      "elf64-alpha-freebsd"
22 #define ELF_ARCH                bfd_arch_alpha
23 #define ELF_MACHINE_CODE        EM_ALPHA
24 #define ELF_MAXPAGESIZE         0x10000
25
26 #include "bfd.h"
27 #include "sysdep.h"
28 #include "elf-bfd.h"
29
30 /* The kernel recognizes executables as valid only if they carry a
31    "FreeBSD" label in the ELF header.  So we put this label on all
32    executables and (for simplicity) also all other object files.  */
33
34 static void elf_alpha_post_process_headers
35   PARAMS ((bfd *, struct bfd_link_info *));
36
37 static void
38 elf_alpha_post_process_headers (abfd, link_info)
39      bfd * abfd;
40      struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
41 {
42   Elf_Internal_Ehdr * i_ehdrp;  /* ELF file header, internal form.  */
43
44   i_ehdrp = elf_elfheader (abfd);
45
46   /* Put an ABI label supported by FreeBSD >= 4.1.  */
47   i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
48 #ifdef OLD_FREEBSD_ABI_LABEL
49   /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard.  */
50   memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8);
51 #endif
52 }
53
54 #define elf_backend_post_process_headers        elf_alpha_post_process_headers
55
56 #include "elf64-alpha.c"