X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Fpe-mips.c;h=1dd85878d9150609afc85288abd3f038f6f6d2cf;hb=4ca0333f073cb4d86fe9d4e64c9dfdca5deba1e0;hp=7bd6e6de9b15993b5e303044ce0ef19696561b01;hpb=b90efa5b79ac1524ec260f8eb89d1be37e0219a7;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c index 7bd6e6de9b..1dd85878d9 100644 --- a/bfd/pe-mips.c +++ b/bfd/pe-mips.c @@ -1,5 +1,5 @@ /* BFD back-end for MIPS PE COFF files. - Copyright (C) 1990-2015 Free Software Foundation, Inc. + Copyright (C) 1990-2016 Free Software Foundation, Inc. Modified from coff-i386.c by DJ Delorie, dj@cygnus.com This file is part of BFD, the Binary File Descriptor library. @@ -95,44 +95,44 @@ coff_mips_reloc (bfd *abfd, #define DOIT(x) \ x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + (diff >> howto->rightshift)) & howto->dst_mask)) - if (diff != 0) - { - reloc_howto_type *howto = reloc_entry->howto; - unsigned char *addr = (unsigned char *) data + reloc_entry->address; + if (diff != 0) + { + reloc_howto_type *howto = reloc_entry->howto; + unsigned char *addr = (unsigned char *) data + reloc_entry->address; - switch (howto->size) + switch (howto->size) + { + case 0: { - case 0: - { - char x = bfd_get_8 (abfd, addr); + char x = bfd_get_8 (abfd, addr); - DOIT (x); - bfd_put_8 (abfd, x, addr); - } - break; - - case 1: - { - short x = bfd_get_16 (abfd, addr); + DOIT (x); + bfd_put_8 (abfd, x, addr); + } + break; - DOIT (x); - bfd_put_16 (abfd, (bfd_vma) x, addr); - } - break; + case 1: + { + short x = bfd_get_16 (abfd, addr); - case 2: - { - long x = bfd_get_32 (abfd, addr); + DOIT (x); + bfd_put_16 (abfd, (bfd_vma) x, addr); + } + break; - DOIT (x); - bfd_put_32 (abfd, (bfd_vma) x, addr); - } - break; + case 2: + { + long x = bfd_get_32 (abfd, addr); - default: - abort (); + DOIT (x); + bfd_put_32 (abfd, (bfd_vma) x, addr); } - } + break; + + default: + abort (); + } + } /* Now let bfd_perform_relocation finish everything up. */ return bfd_reloc_continue; @@ -603,7 +603,7 @@ coff_pe_mips_relocate_section (bfd *output_bfd, struct internal_reloc *rel_end; unsigned int i; - if (info->relocatable) + if (bfd_link_relocatable (info)) { (*_bfd_error_handler) (_("%B: `ld -r' not supported with PE MIPS objects\n"), input_bfd); @@ -661,7 +661,7 @@ coff_pe_mips_relocate_section (bfd *output_bfd, then we should ignore the symbol value. */ if (howto->pc_relative && howto->pcrel_offset) { - if (info->relocatable) + if (bfd_link_relocatable (info)) continue; if (sym != NULL && sym->n_scnum != 0) addend += sym->n_value; @@ -701,13 +701,10 @@ coff_pe_mips_relocate_section (bfd *output_bfd, + sec->output_offset); } - else if (! info->relocatable) - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, input_section, - rel->r_vaddr - input_section->vma, TRUE))) - return FALSE; - } + else if (! bfd_link_relocatable (info)) + (*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, input_section, + rel->r_vaddr - input_section->vma, TRUE); } src = rel->r_vaddr + input_section->output_section->vma