X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bfd%2Felf-m10300.c;h=82f225391b41738682e1658d96dc9ae5f1128fd9;hb=49ded53def53ae60926433b924db9525aae1e631;hp=b5951c6005466a102623b10b2ecae0c4acaf974f;hpb=478c006f9b4a64d59c31aed081c14c1d7dd4ba68;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index b5951c6005..82f225391b 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -1,5 +1,5 @@ /* Matsushita 10300 specific support for 32-bit ELF - Copyright (C) 1996-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -97,9 +97,9 @@ struct elf32_mn10300_link_hash_table struct { bfd_signed_vma refcount; - bfd_vma offset; - char got_allocated; - char rel_emitted; + bfd_vma offset; + char got_allocated; + char rel_emitted; } tls_ldm_got; }; @@ -611,7 +611,7 @@ static reloc_howto_type elf_mn10300_howto_table[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ - NULL, /* special handler. */ + NULL, /* special handler. */ "R_MN10300_SYM_DIFF", /* name */ FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ @@ -625,7 +625,7 @@ static reloc_howto_type elf_mn10300_howto_table[] = FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ - NULL, /* special handler. */ + NULL, /* special handler. */ "R_MN10300_ALIGN", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ @@ -818,11 +818,11 @@ mn10300_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, } static int -elf_mn10300_tls_transition (struct bfd_link_info * info, - int r_type, +elf_mn10300_tls_transition (struct bfd_link_info * info, + int r_type, struct elf_link_hash_entry * h, - asection * sec, - bfd_boolean counting) + asection * sec, + bfd_boolean counting) { bfd_boolean is_local; @@ -888,11 +888,11 @@ tpoff (struct bfd_link_info * info, bfd_vma address) this reloc and the PLT reloc. */ static int -mn10300_do_tls_transition (bfd * input_bfd, - unsigned int r_type, - unsigned int tls_r_type, - bfd_byte * contents, - bfd_vma offset) +mn10300_do_tls_transition (bfd * input_bfd, + unsigned int r_type, + unsigned int tls_r_type, + bfd_byte * contents, + bfd_vma offset) { bfd_byte *op = contents + offset; int gotreg = 0; @@ -962,13 +962,13 @@ mn10300_do_tls_transition (bfd * input_bfd, accordingly, copying the operands as needed. The conversions we do are as follows (IE,GOTIE,LE): - 1111 1100 1010 01Dn [-- abs32 --] MOV (x@indntpoff),Dn - 1111 1100 0000 DnAm [-- abs32 --] MOV (x@gotntpoff,Am),Dn - 1111 1100 1100 11Dn [-- abs32 --] MOV x@tpoff,Dn + 1111 1100 1010 01Dn [-- abs32 --] MOV (x@indntpoff),Dn + 1111 1100 0000 DnAm [-- abs32 --] MOV (x@gotntpoff,Am),Dn + 1111 1100 1100 11Dn [-- abs32 --] MOV x@tpoff,Dn - 1111 1100 1010 00An [-- abs32 --] MOV (x@indntpoff),An - 1111 1100 0010 AnAm [-- abs32 --] MOV (x@gotntpoff,Am),An - 1111 1100 1101 11An [-- abs32 --] MOV x@tpoff,An + 1111 1100 1010 00An [-- abs32 --] MOV (x@indntpoff),An + 1111 1100 0010 AnAm [-- abs32 --] MOV (x@gotntpoff,Am),An + 1111 1100 1101 11An [-- abs32 --] MOV x@tpoff,An 1111 1110 0000 1110 Rnnn Xxxx [-- abs32 --] MOV (x@indntpoff),Rn 1111 1110 0000 1010 Rnnn Rmmm [-- abs32 --] MOV (x@indntpoff,Rm),Rn @@ -1091,10 +1091,6 @@ mn10300_elf_check_relocs (bfd *abfd, while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - - /* PR15323, ref flags aren't set for references in the same - object. */ - h->root.non_ir_ref_regular = 1; } r_type = ELF32_R_TYPE (rel->r_info); @@ -1171,7 +1167,7 @@ mn10300_elf_check_relocs (bfd *abfd, case R_MN10300_TLS_IE: case R_MN10300_TLS_GOTIE: tls_type = GOT_TLS_IE; break; case R_MN10300_TLS_GD: tls_type = GOT_TLS_GD; break; - default: tls_type = GOT_NORMAL; break; + default: tls_type = GOT_NORMAL; break; } sgot = htab->root.sgot; @@ -2596,7 +2592,7 @@ mn10300_elf_symbol_address_p (bfd *abfd, There are quite a few relaxing opportunities available on the mn10300: - * calls:32 -> calls:16 2 bytes + * calls:32 -> calls:16 2 bytes * call:32 -> call:16 2 bytes * call:32 -> calls:32 1 byte @@ -4560,9 +4556,9 @@ elf32_mn10300_link_hash_newfunc (struct bfd_hash_entry *entry, } static void -_bfd_mn10300_copy_indirect_symbol (struct bfd_link_info * info, - struct elf_link_hash_entry * dir, - struct elf_link_hash_entry * ind) +_bfd_mn10300_copy_indirect_symbol (struct bfd_link_info * info, + struct elf_link_hash_entry * dir, + struct elf_link_hash_entry * ind) { struct elf32_mn10300_link_hash_entry * edir; struct elf32_mn10300_link_hash_entry * eind; @@ -4889,7 +4885,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (struct bfd_link_info * info, /* Make sure we know what is going on here. */ BFD_ASSERT (dynobj != NULL && (h->needs_plt - || h->u.weakdef != NULL + || h->is_weakalias || (h->def_dynamic && h->ref_regular && !h->def_regular))); @@ -4962,12 +4958,12 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (struct bfd_link_info * info, /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the real definition first, and we can just use the same value. */ - if (h->u.weakdef != NULL) + if (h->is_weakalias) { - BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined - || h->u.weakdef->root.type == bfd_link_hash_defweak); - h->root.u.def.section = h->u.weakdef->root.u.def.section; - h->root.u.def.value = h->u.weakdef->root.u.def.value; + struct elf_link_hash_entry *def = weakdef (h); + BFD_ASSERT (def->root.type == bfd_link_hash_defined); + h->root.u.def.section = def->root.u.def.section; + h->root.u.def.value = def->root.u.def.value; return TRUE; } @@ -5207,11 +5203,11 @@ _bfd_mn10300_elf_finish_dynamic_symbol (bfd * output_bfd, if (h->plt.offset != (bfd_vma) -1) { - asection * splt; - asection * sgot; - asection * srel; - bfd_vma plt_index; - bfd_vma got_offset; + asection * splt; + asection * sgot; + asection * srel; + bfd_vma plt_index; + bfd_vma got_offset; Elf_Internal_Rela rel; /* This symbol has an entry in the procedure linkage table. Set @@ -5293,8 +5289,8 @@ _bfd_mn10300_elf_finish_dynamic_symbol (bfd * output_bfd, if (h->got.offset != (bfd_vma) -1) { - asection * sgot; - asection * srel; + asection * sgot; + asection * srel; Elf_Internal_Rela rel; /* This symbol has an entry in the global offset table. Set it up. */ @@ -5368,7 +5364,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (bfd * output_bfd, if (h->needs_copy) { - asection * s; + asection * s; Elf_Internal_Rela rel; /* This symbol needs a copy reloc. Set it up. */ @@ -5416,7 +5412,7 @@ _bfd_mn10300_elf_finish_dynamic_sections (bfd * output_bfd, if (elf_hash_table (info)->dynamic_sections_created) { - asection * splt; + asection * splt; Elf32_External_Dyn * dyncon; Elf32_External_Dyn * dynconend; @@ -5579,7 +5575,7 @@ mn10300_elf_mkobject (bfd *abfd) #define elf_backend_size_dynamic_sections \ _bfd_mn10300_elf_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true) #define elf_backend_finish_dynamic_symbol \ _bfd_mn10300_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \