diff options
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r-- | bfd/elf64-alpha.c | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 6480612..a1f4e03 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -2111,7 +2111,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) /* If the symbol isn't defined in the current module, again we can't do anything. */ - if (!h->root.def_regular) + if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) { /* Except for TLSGD relocs, which can sometimes be relaxed to GOTTPREL relocs. */ @@ -2450,7 +2450,7 @@ elf64_alpha_create_dynamic_sections (abfd, info) get_elf_backend_data (abfd)->collect, &bh))) return FALSE; h = (struct elf_link_hash_entry *) bh; - h->def_regular = 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; if (info->shared @@ -2494,7 +2494,7 @@ elf64_alpha_create_dynamic_sections (abfd, info) FALSE, get_elf_backend_data (abfd)->collect, &bh))) return FALSE; h = (struct elf_link_hash_entry *) bh; - h->def_regular = 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; if (info->shared @@ -2741,9 +2741,10 @@ elf64_alpha_output_extsym (h, data) if (h->root.indx == -2) strip = FALSE; - else if ((h->root.def_dynamic || h->root.ref_dynamic) - && !h->root.def_regular - && !h->root.ref_regular) + else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + || (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0) + && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0) strip = TRUE; else if (einfo->info->strip == strip_all || (einfo->info->strip == strip_some @@ -2830,7 +2831,7 @@ elf64_alpha_output_extsym (h, data) else h->esym.asym.value = 0; } - else if (h->root.needs_plt) + else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { /* Set type and value for a symbol with a function stub. */ h->esym.asym.st = stProc; @@ -2997,7 +2998,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) || h->root.root.type == bfd_link_hash_warning) h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; - h->root.ref_regular = 1; + h->root.elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; } /* We can only get preliminary data on whether a symbol is @@ -3007,7 +3008,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) maybe_dynamic = FALSE; if (h && ((info->shared && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE)) - || !h->root.def_regular + || ! (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) || h->root.root.type == bfd_link_hash_defweak)) maybe_dynamic = TRUE; @@ -3113,9 +3114,9 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) /* Make a guess as to whether a .plt entry is needed. */ if ((gotent_flags & ALPHA_ELF_LINK_HASH_LU_FUNC) && !(gotent_flags & ~ALPHA_ELF_LINK_HASH_LU_FUNC)) - h->root.needs_plt = 1; + h->root.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; else - h->root.needs_plt = 0; + h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } } } @@ -3239,7 +3240,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h) somewhere later. But for now don't bother. */ && ah->got_entries) { - h->needs_plt = 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; s = bfd_get_section_by_name(dynobj, ".plt"); if (!s && !elf64_alpha_create_dynamic_sections (dynobj, info)) @@ -3274,17 +3275,17 @@ elf64_alpha_adjust_dynamic_symbol (info, h) return TRUE; } else - h->needs_plt = 0; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; /* 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->weakdef != NULL) { - 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; + BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined + || h->weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->weakdef->root.u.def.section; + h->root.u.def.value = h->weakdef->root.u.def.value; return TRUE; } @@ -3726,7 +3727,7 @@ elf64_alpha_size_plt_section_1 (h, data) struct alpha_elf_got_entry *gotent; /* If we didn't need an entry before, we still don't. */ - if (!h->root.needs_plt) + if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)) return TRUE; /* There must still be a LITERAL got entry for the function. */ @@ -3746,7 +3747,7 @@ elf64_alpha_size_plt_section_1 (h, data) } else { - h->root.needs_plt = 0; + h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; h->root.plt.offset = -1; /* Undo the definition frobbing begun in adjust_dynamic_symbol. */ @@ -3848,13 +3849,15 @@ elf64_alpha_calc_dynrel_sizes (h, info) set. This is done for dynamic symbols in elf_adjust_dynamic_symbol but this is not done for non-dynamic symbols, somehow. */ - if (!h->root.def_regular - && h->root.ref_regular - && !h->root.def_dynamic + if (((h->root.elf_link_hash_flags + & (ELF_LINK_HASH_DEF_REGULAR + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_DYNAMIC)) + == ELF_LINK_HASH_REF_REGULAR) && (h->root.root.type == bfd_link_hash_defined || h->root.root.type == bfd_link_hash_defweak) && !(h->root.root.u.def.section->owner->flags & DYNAMIC)) - h->root.def_regular = 1; + h->root.elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; /* If the symbol is dynamic, we'll need all the relocations in their natural form. If this is a shared object, and it has been forced @@ -4894,7 +4897,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) loc = srel->contents + plt_index * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - if (!h->def_regular) + if (!(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) { /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ |