X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf32-rl78.c;h=bc1f3c72cc31873e0cd370ecae959352ffbd1aee;hb=eeb2f20a764bee3a6a1edb9872467d044aaad848;hp=c6ee06ba9ddfcdeb98ed40f6e86e6425590d259a;hpb=695344c018c8e462280c47a644df02ea472b0a4e;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c index c6ee06ba9d..bc1f3c72cc 100644 --- a/bfd/elf32-rl78.c +++ b/bfd/elf32-rl78.c @@ -1,5 +1,5 @@ /* Renesas RL78 specific support for 32-bit ELF. - Copyright (C) 2011-2016 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -685,17 +685,13 @@ rl78_elf_relocate_section struct elf_link_hash_entry ** sym_hashes; Elf_Internal_Rela * rel; Elf_Internal_Rela * relend; - bfd *dynobj; asection *splt; symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); relend = relocs + input_section->reloc_count; - dynobj = elf_hash_table (info)->dynobj; - splt = NULL; - if (dynobj != NULL) - splt = bfd_get_linker_section (dynobj, ".plt"); + splt = elf_hash_table (info)->splt; for (rel = relocs; rel < relend; rel ++) { @@ -1202,9 +1198,9 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) _bfd_error_handler /* xgettext:c-format */ - (_("RL78 ABI conflict: G10 file %s cannot be linked with %s file %s"), - bfd_get_filename (ibfd), - rl78_cpu_name (out_cpu), bfd_get_filename (obfd)); + (_("RL78 ABI conflict: G10 file %B cannot be linked" + " with %s file %B"), + ibfd, rl78_cpu_name (out_cpu), obfd); } else { @@ -1219,9 +1215,9 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) _bfd_error_handler /* xgettext:c-format */ - (_("RL78 ABI conflict: cannot link %s file %s with %s file %s"), - rl78_cpu_name (in_cpu), bfd_get_filename (ibfd), - rl78_cpu_name (out_cpu), bfd_get_filename (obfd)); + (_("RL78 ABI conflict: cannot link %s file %B with %s file %B"), + rl78_cpu_name (in_cpu), ibfd, + rl78_cpu_name (out_cpu), obfd); } } @@ -1232,12 +1228,12 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (old_flags & E_FLAG_RL78_64BIT_DOUBLES) /* xgettext:c-format */ - _bfd_error_handler (_("- %s is 64-bit, %s is not"), - bfd_get_filename (obfd), bfd_get_filename (ibfd)); + _bfd_error_handler (_("- %B is 64-bit, %B is not"), + obfd, ibfd); else /* xgettext:c-format */ - _bfd_error_handler (_("- %s is 64-bit, %s is not"), - bfd_get_filename (ibfd), bfd_get_filename (obfd)); + _bfd_error_handler (_("- %B is 64-bit, %B is not"), + ibfd, obfd); error = TRUE; } } @@ -1311,7 +1307,6 @@ rl78_elf_check_relocs symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); local_plt_offsets = elf_local_got_offsets (abfd); - splt = NULL; dynobj = elf_hash_table(info)->dynobj; rel_end = relocs + sec->reloc_count; @@ -1333,7 +1328,7 @@ rl78_elf_check_relocs /* PR15323, ref flags aren't set for references in the same object. */ - h->root.non_ir_ref = 1; + h->root.non_ir_ref_regular = 1; } switch (ELF32_R_TYPE (rel->r_info)) @@ -1344,20 +1339,18 @@ rl78_elf_check_relocs case R_RL78_DIR16S: if (dynobj == NULL) elf_hash_table (info)->dynobj = dynobj = abfd; + splt = elf_hash_table (info)->splt; if (splt == NULL) { - splt = bfd_get_linker_section (dynobj, ".plt"); - if (splt == NULL) - { - flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY | SEC_LINKER_CREATED - | SEC_READONLY | SEC_CODE); - splt = bfd_make_section_anyway_with_flags (dynobj, ".plt", - flags); - if (splt == NULL - || ! bfd_set_section_alignment (dynobj, splt, 1)) - return FALSE; - } + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY | SEC_CODE); + splt = bfd_make_section_anyway_with_flags (dynobj, ".plt", + flags); + elf_hash_table (info)->splt = splt; + if (splt == NULL + || ! bfd_set_section_alignment (dynobj, splt, 1)) + return FALSE; } if (h != NULL) @@ -1414,8 +1407,9 @@ rl78_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED, if (info->relax_trip > 0) return TRUE; - if ((dynobj = elf_hash_table (info)->dynobj) != NULL - && (splt = bfd_get_linker_section (dynobj, ".plt")) != NULL) + dynobj = elf_hash_table (info)->dynobj; + splt = elf_hash_table (info)->splt; + if (dynobj != NULL && splt != NULL) { bfd_byte *contents = splt->contents; unsigned int i, size = splt->size; @@ -1444,7 +1438,7 @@ rl78_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if (dynobj == NULL) return TRUE; - splt = bfd_get_linker_section (dynobj, ".plt"); + splt = elf_hash_table (info)->splt; BFD_ASSERT (splt != NULL); splt->contents = (bfd_byte *) bfd_zalloc (dynobj, splt->size);