aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-m68k.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-09-16 14:52:12 +0000
committerAlan Modra <amodra@gmail.com>2004-09-16 14:52:12 +0000
commitf5385ebfb8e4e9e336adba121a22d110488303d1 (patch)
tree9e0255b2253d334ed022b14e44bf44c23f909e22 /bfd/elf32-m68k.c
parentb6ee372a3e4a3c008d6576e6b5ab51f1cf01bed4 (diff)
downloadgdb-f5385ebfb8e4e9e336adba121a22d110488303d1.zip
gdb-f5385ebfb8e4e9e336adba121a22d110488303d1.tar.gz
gdb-f5385ebfb8e4e9e336adba121a22d110488303d1.tar.bz2
* elf-bfd.h (struct elf_link_hash_entry): Replace elf_link_hash_flags
with bitfields. Make "type" and "other" bitfields too. (ELF_LINK_HASH_REF_REGULAR, ELF_LINK_HASH_DEF_REGULAR, ELF_LINK_HASH_REF_DYNAMIC, ELF_LINK_HASH_DEF_DYNAMIC, ELF_LINK_HASH_REF_REGULAR_NONWEAK, ELF_LINK_HASH_DYNAMIC_ADJUSTED, ELF_LINK_HASH_NEEDS_COPY, ELF_LINK_HASH_NEEDS_PLT, ELF_LINK_NON_ELF, ELF_LINK_HIDDEN, ELF_LINK_FORCED_LOCAL, ELF_LINK_HASH_MARK, ELF_LINK_NON_GOT_REF, ELF_LINK_DYNAMIC_DEF, ELF_LINK_DYNAMIC_WEAK, ELF_LINK_POINTER_EQUALITY_NEEDED): Delete. (ELF_COMMON_DEF_P, WILL_CALL_FINISH_DYNAMIC_SYMBOL): Update. * elf-hppa.h: Update all uses of elf_link_hash_flags. * elf-m10300.c: Likewise. * elf.c: Likewise. * elf32-arm.h: Likewise. * elf32-cris.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68k.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-sparc.c: Likewise. * elf32-vax.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * configure.in (AM_INIT_AUTOMAKE): Set version to 2.15.92. * configure: Regenerate. * aclocal.m4: Regenerate.
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r--bfd/elf32-m68k.c64
1 files changed, 29 insertions, 35 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 08cc793..a7696cd 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -506,7 +506,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
{
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1
- && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+ && !h->forced_local)
{
if (!bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
@@ -564,7 +564,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
if (h == NULL)
continue;
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ h->needs_plt = 1;
h->plt.refcount++;
break;
@@ -584,13 +584,13 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1
- && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+ && !h->forced_local)
{
if (!bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ h->needs_plt = 1;
h->plt.refcount++;
break;
@@ -612,8 +612,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
&& h != NULL
&& (!info->symbolic
|| h->root.type == bfd_link_hash_defweak
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0)))
+ || !h->def_regular)))
{
if (h != NULL)
{
@@ -925,24 +924,21 @@ elf_m68k_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. */
@@ -953,7 +949,7 @@ elf_m68k_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;
}
@@ -961,14 +957,14 @@ elf_m68k_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;
}
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1
- && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+ && !h->forced_local)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
@@ -993,7 +989,7 @@ elf_m68k_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;
@@ -1071,7 +1067,7 @@ elf_m68k_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
@@ -1295,9 +1291,9 @@ elf_m68k_discard_copies (h, inf)
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ if (!h->def_regular
|| (!info->symbolic
- && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0))
+ && !h->forced_local))
{
if ((info->flags & DF_TEXTREL) == 0)
{
@@ -1442,8 +1438,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
|| (info->shared
&& (info->symbolic
|| h->dynindx == -1
- || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) != 0)
+ || h->forced_local)
+ && h->def_regular))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -1579,7 +1575,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
case R_68K_PC32:
if (h == NULL
|| (info->shared
- && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
+ && h->forced_local))
break;
/* Fall through. */
case R_68K_8:
@@ -1597,8 +1593,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
|| (h != NULL
&& h->dynindx != -1
&& (!info->symbolic
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ || !h->def_regular))))
{
Elf_Internal_Rela outrel;
bfd_byte *loc;
@@ -1630,8 +1625,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
|| r_type == R_68K_PC32
|| !info->shared
|| !info->symbolic
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ || !h->def_regular))
{
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
outrel.r_addend = rel->r_addend;
@@ -1702,7 +1696,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
not process them. */
if (unresolved_reloc
&& !((input_section->flags & SEC_DEBUGGING) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
+ && h->def_dynamic))
{
(*_bfd_error_handler)
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
@@ -1854,7 +1848,7 @@ elf_m68k_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. */
@@ -1888,8 +1882,8 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
if (info->shared
&& (info->symbolic
|| h->dynindx == -1
- || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ || h->forced_local)
+ && h->def_regular)
{
rela.r_info = ELF32_R_INFO (0, R_68K_RELATIVE);
rela.r_addend = bfd_get_signed_32 (output_bfd,
@@ -1909,7 +1903,7 @@ elf_m68k_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;