* elflink.h (elf_link_add_object_symbols): Error out on dynamic objects
[binutils.git] / bfd / elf32-i386-fbsd.c
blob500e0ebc04853d98ce2004ced13a4215492a2c3a
1 /* Intel IA-32 specific support for 32-bit ELF on FreeBSD.
2 Copyright 2002 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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. */
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
26 #include "bfd.h"
27 #include "sysdep.h"
28 #include "elf-bfd.h"
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. */
34 static void elf_i386_post_process_headers
35 PARAMS ((bfd *, struct bfd_link_info *));
37 static void
38 elf_i386_post_process_headers (abfd, link_info)
39 bfd * abfd;
40 struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
42 Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */
44 i_ehdrp = elf_elfheader (abfd);
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
54 #define elf_backend_post_process_headers elf_i386_post_process_headers
56 #include "elf32-i386.c"