X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-i386.c;h=af2011ec96b52921661d4a40335419bd5b164e99;hb=e3e163dbb0c50aa94af5416aca86d9ef9c225205;hp=2609130d81ac126418397ecd818dfcbde3e9ae00;hpb=61315175ad029ee37a415cb1becd0bfecd44c430;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 2609130d81..af2011ec96 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1,7 +1,5 @@ /* Intel 80386/80486-specific support for 32-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 - Free Software Foundation, Inc. + Copyright (C) 1993-2014 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2197,7 +2195,8 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) if (h->type == STT_GNU_IFUNC && h->def_regular) return _bfd_elf_allocate_ifunc_dyn_relocs (info, h, &eh->dyn_relocs, - plt_entry_size, 4); + plt_entry_size, + plt_entry_size, 4); else if (htab->elf.dynamic_sections_created && h->plt.refcount > 0) { @@ -2218,7 +2217,7 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) /* If this is the first .plt entry, make room for the special first entry. */ if (s->size == 0) - s->size += plt_entry_size; + s->size = plt_entry_size; h->plt.offset = s->size; @@ -3310,11 +3309,12 @@ elf_i386_relocate_section (bfd *output_bfd, else { bfd_boolean warned ATTRIBUTE_UNUSED; + bfd_boolean ignored ATTRIBUTE_UNUSED; RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, h, sec, relocation, - unresolved_reloc, warned); + unresolved_reloc, warned, ignored); st_size = h->size; } @@ -5066,8 +5066,6 @@ elf_i386_add_symbol_hook (bfd * abfd, #define elf_backend_plt_sym_val elf_i386_plt_sym_val #define elf_backend_hash_symbol elf_i386_hash_symbol #define elf_backend_add_symbol_hook elf_i386_add_symbol_hook -#undef elf_backend_post_process_headers -#define elf_backend_post_process_headers _bfd_elf_set_osabi #include "elf32-target.h" @@ -5087,7 +5085,7 @@ elf_i386_add_symbol_hook (bfd * abfd, static void elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info) { - _bfd_elf_set_osabi (abfd, info); + _bfd_elf_post_process_headers (abfd, info); #ifdef OLD_FREEBSD_ABI_LABEL /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ @@ -5149,7 +5147,6 @@ elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info) #undef elf_backend_want_plt_sym #define elf_backend_want_plt_sym 0 #undef elf_backend_post_process_headers -#define elf_backend_post_process_headers _bfd_elf_set_osabi #undef elf_backend_static_tls_alignment /* NaCl uses substantially different PLT entries for the same effects. */ @@ -5294,19 +5291,33 @@ static const struct elf_i386_backend_data elf_i386_nacl_arch_bed = 0, /* is_vxworks */ }; +static bfd_boolean +elf32_i386_nacl_elf_object_p (bfd *abfd) +{ + /* Set the right machine number for a NaCl i386 ELF32 file. */ + bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_i386_i386_nacl); + return TRUE; +} + #undef elf_backend_arch_data #define elf_backend_arch_data &elf_i386_nacl_arch_bed +#undef elf_backend_object_p +#define elf_backend_object_p elf32_i386_nacl_elf_object_p #undef elf_backend_modify_segment_map #define elf_backend_modify_segment_map nacl_modify_segment_map #undef elf_backend_modify_program_headers #define elf_backend_modify_program_headers nacl_modify_program_headers +#undef elf_backend_final_write_processing +#define elf_backend_final_write_processing nacl_final_write_processing #include "elf32-target.h" /* Restore defaults. */ +#undef elf_backend_object_p #undef elf_backend_modify_segment_map #undef elf_backend_modify_program_headers +#undef elf_backend_final_write_processing /* VxWorks support. */ @@ -5329,7 +5340,6 @@ static const struct elf_i386_backend_data elf_i386_vxworks_arch_bed = #define elf_backend_arch_data &elf_i386_vxworks_arch_bed #undef elf_backend_relocs_compatible -#undef elf_backend_post_process_headers #undef elf_backend_add_symbol_hook #define elf_backend_add_symbol_hook \ elf_vxworks_add_symbol_hook