diff options
Diffstat (limited to 'bfd/elf32-vax.c')
-rw-r--r-- | bfd/elf32-vax.c | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index a0249b1..6cf279e 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -682,7 +682,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs) if (h == NULL) continue; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->needs_plt = 1; if (h->plt.refcount == -1) h->plt.refcount = 1; else @@ -706,8 +706,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs) && (sec->flags & SEC_ALLOC) != 0 && h != NULL && (!info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))) + || !h->def_regular))) { if (h != NULL) { @@ -962,24 +961,21 @@ elf_vax_adjust_dynamic_symbol (info, h) /* Make sure we know what is going on here. */ BFD_ASSERT (dynobj != NULL - && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) + && (h->needs_plt || h->weakdef != NULL - || ((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_REF_REGULAR) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))); + || (h->def_dynamic + && h->ref_regular + && !h->def_regular))); /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, when we know the address of the .got section. */ if (h->type == STT_FUNC - || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) + || h->needs_plt) { if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 + && !h->def_dynamic + && !h->ref_dynamic /* We must always create the plt entry if it was referenced by a PLTxxO relocation. In this case we already recorded it as a dynamic symbol. */ @@ -990,7 +986,7 @@ elf_vax_adjust_dynamic_symbol (info, h) object. In such a case, we don't actually need to build a procedure linkage table, and we can just do a PCxx reloc instead. */ - BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0); + BFD_ASSERT (h->needs_plt); h->plt.offset = (bfd_vma) -1; return TRUE; } @@ -998,7 +994,7 @@ elf_vax_adjust_dynamic_symbol (info, h) /* GC may have rendered this entry unused. */ if (h->plt.refcount <= 0) { - h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + h->needs_plt = 0; h->plt.offset = (bfd_vma) -1; return TRUE; } @@ -1026,7 +1022,7 @@ elf_vax_adjust_dynamic_symbol (info, h) pointers compare as equal between the normal executable and the shared library. */ if (!info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + && !h->def_regular) { h->root.u.def.section = s; h->root.u.def.value = s->size; @@ -1103,7 +1099,7 @@ elf_vax_adjust_dynamic_symbol (info, h) srel = bfd_get_section_by_name (dynobj, ".rela.bss"); BFD_ASSERT (srel != NULL); srel->size += sizeof (Elf32_External_Rela); - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; + h->needs_copy = 1; } /* We need to figure out the alignment required for this symbol. I @@ -1349,7 +1345,7 @@ elf_vax_discard_copies (h, ignore) h = (struct elf_vax_link_hash_entry *) h->root.root.u.i.link; /* We only discard relocs for symbols defined in a regular object. */ - if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + if (!h->root.def_regular) return TRUE; for (s = h->pcrel_relocs_copied; s != NULL; s = s->next) @@ -1504,12 +1500,10 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, && elf_hash_table (info)->dynamic_sections_created && (! info->shared || (! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) + || !h->def_regular)) || (info->shared && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) + || !h->def_regular) && ((input_section->flags & SEC_ALLOC) != 0 /* DWARF will emit R_VAX_32 relocations in its sections against symbols defined externally @@ -1517,8 +1511,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, with them here. */ || ((input_section->flags & SEC_DEBUGGING) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) + && h->def_dynamic)) && (r_type == R_VAX_8 || r_type == R_VAX_16 || r_type == R_VAX_32 @@ -1558,7 +1551,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, if (info->shared && h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + && h->def_regular) { /* The symbol was forced to be local because of a version file.. We must initialize @@ -1665,8 +1658,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, && r_type != R_VAX_PC16 && r_type != R_VAX_PC32) || (!info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0))) + || !h->def_regular))) { Elf_Internal_Rela outrel; bfd_byte *loc; @@ -1714,8 +1706,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section, become local. */ else if (h != NULL && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) + || !h->def_regular)) { BFD_ASSERT (h->dynindx != -1); outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); @@ -1923,7 +1914,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym) loc = srela->contents + plt_index * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + if (!h->def_regular) { /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ @@ -1954,7 +1945,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym) the relocate_section function. */ if (info->shared && h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + && h->def_regular) { rela.r_info = ELF32_R_INFO (0, R_VAX_RELATIVE); } @@ -1971,7 +1962,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); } - if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) + if (h->needs_copy) { asection *s; Elf_Internal_Rela rela; |