X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felfxx-tilegx.c;h=41af167e1e187df686df92302b544611134f3ef9;hb=7190276c52b9d86a52aae73d3a0f8b56e7a1f4f1;hp=8662db598ea409aa0c081cb7d56353fa341a68eb;hpb=07d6d2b8345ef3dc82eab49635acac9ee67dbb18;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c index 8662db598e..41af167e1e 100644 --- a/bfd/elfxx-tilegx.c +++ b/bfd/elfxx-tilegx.c @@ -1,5 +1,5 @@ /* TILE-Gx-specific support for ELF. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -892,7 +892,7 @@ tilegx_put_word_32 (bfd *abfd, bfd_vma val, void *ptr) } reloc_howto_type * -tilegx_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, +tilegx_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code) { unsigned int i; @@ -908,6 +908,10 @@ tilegx_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, - entry->table[0].type); } + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, (int) code); + bfd_set_error (bfd_error_bad_value); return NULL; } @@ -928,7 +932,7 @@ tilegx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } -void +bfd_boolean tilegx_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) @@ -938,11 +942,19 @@ tilegx_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type <= (unsigned int) R_TILEGX_IMM8_Y1_TLS_ADD) cache_ptr->howto = &tilegx_elf_howto_table [r_type]; else if (r_type - R_TILEGX_GNU_VTINHERIT - <= (unsigned int) R_TILEGX_GNU_VTENTRY) + <= ((unsigned int) R_TILEGX_GNU_VTENTRY + - (unsigned int) R_TILEGX_GNU_VTINHERIT)) cache_ptr->howto = &tilegx_elf_howto_table2 [r_type - R_TILEGX_GNU_VTINHERIT]; else - abort (); + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } typedef tilegx_bundle_bits (*tilegx_create_func)(int); @@ -1426,13 +1438,13 @@ tilegx_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) (bed->dynamic_sec_flags | SEC_READONLY)); if (s == NULL - || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + || !bfd_set_section_alignment (s, bed->s->log_file_align)) return FALSE; htab->srelgot = s; s = s_got = bfd_make_section_anyway_with_flags (abfd, ".got", flags); if (s == NULL - || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + || !bfd_set_section_alignment (s, bed->s->log_file_align)) return FALSE; htab->sgot = s; @@ -1443,8 +1455,7 @@ tilegx_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) { s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags); if (s == NULL - || !bfd_set_section_alignment (abfd, s, - bed->s->log_file_align)) + || !bfd_set_section_alignment (s, bed->s->log_file_align)) return FALSE; htab->sgotplt = s; @@ -1685,7 +1696,7 @@ tilegx_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -1790,7 +1801,7 @@ tilegx_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h ? h->root.root.string : ""); return FALSE; } @@ -2476,7 +2487,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2499,7 +2510,7 @@ tilegx_elf_omit_section_dynsym (bfd *output_bfd, if (strcmp (p->name, ".got") == 0) return FALSE; - return _bfd_elf_link_omit_section_dynsym (output_bfd, info, p); + return _bfd_elf_omit_section_dynsym_default (output_bfd, info, p); } bfd_boolean @@ -2564,7 +2575,7 @@ tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, { info->flags |= DF_TEXTREL; - info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"), + info->callbacks->minfo (_("%pB: dynamic relocation in read-only section `%pA'\n"), p->sec->owner, p->sec); } } @@ -3020,7 +3031,7 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, name = (bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name)); if (name == NULL || *name == '\0') - name = bfd_section_name (input_bfd, sec); + name = bfd_section_name (sec); } switch (r_type) @@ -3528,7 +3539,7 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { BFD_FAIL (); _bfd_error_handler - (_("%B: probably compiled without -fPIC?"), + (_("%pB: probably compiled without -fPIC?"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3778,10 +3789,11 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, rel->r_offset) != (bfd_vma) -1) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); @@ -4129,7 +4141,7 @@ tilegx_elf_finish_dynamic_sections (bfd *output_bfd, if (bfd_is_abs_section (htab->elf.sgotplt->output_section)) { _bfd_error_handler - (_("discarded output section: `%A'"), htab->elf.sgotplt); + (_("discarded output section: `%pA'"), htab->elf.sgotplt); return FALSE; } @@ -4238,7 +4250,7 @@ _bfd_tilegx_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Cannot link together %s and %s objects."), + (_("%pB: cannot link together %s and %s objects"), ibfd, targ1, targ2); bfd_set_error (bfd_error_bad_value); return FALSE;