X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf64-mmix.c;h=b15ef9f9bb375b346e12debfeca53463e583a521;hb=82418e18f81ea76deb633b7531f197b13e77bc8f;hp=c7e1c250d9b74858dd2b3f2c977733c7863828db;hpb=62d887d4067efbc5b757e03b0fa54f2a4c81befa;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index c7e1c250d9..b15ef9f9bb 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -1,7 +1,5 @@ /* MMIX-specific support for 64-bit ELF. - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, - 2012 - Free Software Foundation, Inc. + Copyright (C) 2001-2016 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson This file is part of BFD, the Binary File Descriptor library. @@ -194,11 +192,11 @@ static reloc_howto_type elf_mmix_howto_table[] = /* This reloc does nothing. */ HOWTO (R_MMIX_NONE, /* type */ 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ + 3, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MMIX_NONE", /* name */ FALSE, /* partial_inplace */ @@ -1261,7 +1259,11 @@ mmix_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type; r_type = ELF64_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_MMIX_max); + if (r_type >= (unsigned int) R_MMIX_max) + { + _bfd_error_handler (_("%B: invalid MMIX reloc number: %d"), abfd, r_type); + r_type = 0; + } cache_ptr->howto = &elf_mmix_howto_table[r_type]; } @@ -1427,7 +1429,7 @@ mmix_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, rel, 1, relend, howto, 0, contents); - if (info->relocatable) + if (bfd_link_relocatable (info)) { /* This is a relocatable link. For most relocs we don't have to change anything, unless the reloc is against a section @@ -1868,7 +1870,7 @@ mmix_elf_check_common_relocs (bfd *abfd, DSO-related stuff if that member is non-NULL. */ case R_MMIX_BASE_PLUS_OFFSET: /* We don't do anything with this reloc for a relocatable link. */ - if (info->relocatable) + if (bfd_link_relocatable (info)) break; if (bpo_greg_owner == NULL) @@ -1992,7 +1994,7 @@ mmix_elf_check_relocs (bfd *abfd, if (!mmix_elf_check_common_relocs (abfd, info, sec, relocs)) return FALSE; - if (info->relocatable) + if (bfd_link_relocatable (info)) return TRUE; rel_end = relocs + sec->reloc_count; @@ -2112,9 +2114,7 @@ static asymbol *mmix_elf_reg_section_symbol_ptr; /* Handle the special section numbers that a symbol may use. */ void -mmix_elf_symbol_processing (abfd, asym) - bfd *abfd ATTRIBUTE_UNUSED; - asymbol *asym; +mmix_elf_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, asymbol *asym) { elf_symbol_type *elfsym; @@ -2301,7 +2301,7 @@ mmix_set_relaxable_size (bfd *abfd ATTRIBUTE_UNUSED, /* For use in relocatable link, we start with a max stubs size. See mmix_elf_relax_section. */ - if (info->relocatable && sec->output_section) + if (bfd_link_relocatable (info) && sec->output_section) mmix_elf_section_data (sec->output_section)->pjs.stubs_size_sum += (mmix_elf_section_data (sec)->pjs.n_pushj_relocs * MAX_PUSHJ_STUB_SIZE); @@ -2324,7 +2324,7 @@ _bfd_mmix_before_linker_allocation (bfd *abfd ATTRIBUTE_UNUSED, bfd *ibfd; /* Set the initial size of sections. */ - for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) bfd_map_over_sections (ibfd, mmix_set_relaxable_size, info); /* The bpo_greg_owner bfd is supposed to have been set by @@ -2489,9 +2489,8 @@ bpo_reloc_request_sort_fn (const void * p1, const void * p2) from base-plus-offset relocs. */ void -mmix_dump_bpo_gregs (link_info, pf) - struct bfd_link_info *link_info; - bfd_error_handler_type pf; +mmix_dump_bpo_gregs (struct bfd_link_info *link_info, + bfd_error_handler_type pf) { bfd *bpo_greg_owner; asection *bpo_gregs_section; @@ -2622,7 +2621,7 @@ mmix_elf_relax_section (bfd *abfd, /* We process relocs in a distinctly different way when this is a relocatable link (for one, we don't look at symbols), so we avoid mixing its code with that for the "normal" relaxation. */ - if (link_info->relocatable) + if (bfd_link_relocatable (link_info)) { /* The only transformation in a relocatable link is to generate a full stub at the location of the stub calculated for the @@ -2904,7 +2903,7 @@ mmix_elf_relax_section (bfd *abfd, alignment. */ #define ELF_MAXPAGESIZE 0x100 -#define TARGET_BIG_SYM bfd_elf64_mmix_vec +#define TARGET_BIG_SYM mmix_elf64_vec #define TARGET_BIG_NAME "elf64-mmix" #define elf_info_to_howto_rel NULL