1104871Sobrien/* Intel IA-32 specific support for 32-bit ELF on FreeBSD. 2104871Sobrien Copyright 2002 Free Software Foundation, Inc. 3104871Sobrien 4104871SobrienThis file is part of BFD, the Binary File Descriptor library. 5104871Sobrien 6104871SobrienThis program is free software; you can redistribute it and/or modify 7104871Sobrienit under the terms of the GNU General Public License as published by 8104871Sobrienthe Free Software Foundation; either version 2 of the License, or 9104871Sobrien(at your option) any later version. 10104871Sobrien 11104871SobrienThis program is distributed in the hope that it will be useful, 12104871Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of 13104871SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14104871SobrienGNU General Public License for more details. 15104871Sobrien 16104871SobrienYou should have received a copy of the GNU General Public License 17104871Sobrienalong with this program; if not, write to the Free Software 18104871SobrienFoundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 19104871Sobrien 20104871Sobrien#define TARGET_LITTLE_SYM bfd_elf32_i386_freebsd_vec 21104871Sobrien#define TARGET_LITTLE_NAME "elf32-i386-freebsd" 22104871Sobrien#define ELF_ARCH bfd_arch_i386 23104871Sobrien#define ELF_MACHINE_CODE EM_386 24104871Sobrien#define ELF_MAXPAGESIZE 0x1000 25104871Sobrien 26104871Sobrien#include "bfd.h" 27104871Sobrien#include "sysdep.h" 28104871Sobrien#include "elf-bfd.h" 29104871Sobrien 30104871Sobrien/* The kernel recognizes executables as valid only if they carry a 31104871Sobrien "FreeBSD" label in the ELF header. So we put this label on all 32104871Sobrien executables and (for simplicity) also all other object files. */ 33104871Sobrien 34104871Sobrienstatic void elf_i386_post_process_headers 35104871Sobrien PARAMS ((bfd *, struct bfd_link_info *)); 36104871Sobrien 37104871Sobrienstatic void 38104871Sobrienelf_i386_post_process_headers (abfd, link_info) 39104871Sobrien bfd * abfd; 40104871Sobrien struct bfd_link_info * link_info ATTRIBUTE_UNUSED; 41104871Sobrien{ 42104871Sobrien Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ 43104871Sobrien 44104871Sobrien i_ehdrp = elf_elfheader (abfd); 45104871Sobrien 46104871Sobrien /* Put an ABI label supported by FreeBSD >= 4.1. */ 47104871Sobrien i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; 48104871Sobrien#ifdef OLD_FREEBSD_ABI_LABEL 49104871Sobrien /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ 50104871Sobrien memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); 51104871Sobrien#endif 52104871Sobrien} 53104871Sobrien 54104871Sobrien#define elf_backend_post_process_headers elf_i386_post_process_headers 55104871Sobrien 56104871Sobrien#include "elf32-i386.c" 57