Commit | Line | Data |
---|---|---|
4ada7262 DB |
1 | /* Intel IA-32 specific support for 32-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 | ||
290062cc DB |
20 | #define TARGET_LITTLE_SYM bfd_elf32_i386_freebsd_vec |
21 | #define TARGET_LITTLE_NAME "elf32-i386-freebsd" | |
22 | #define ELF_ARCH bfd_arch_i386 | |
23 | #define ELF_MACHINE_CODE EM_386 | |
24 | #define ELF_MAXPAGESIZE 0x1000 | |
4ada7262 DB |
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_i386_post_process_headers | |
35 | PARAMS ((bfd *, struct bfd_link_info *)); | |
36 | ||
37 | static void | |
38 | elf_i386_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 | ||
290062cc DB |
46 | /* Put an ABI label supported by FreeBSD >= 4.1. */ |
47 | i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; | |
4ada7262 DB |
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); | |
4ada7262 DB |
51 | #endif |
52 | } | |
53 | ||
54 | #define elf_backend_post_process_headers elf_i386_post_process_headers | |
55 | ||
56 | #include "elf32-i386.c" |