summaryrefslogtreecommitdiff
path: root/bfd/elf-m10300.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-09-16 14:52:12 +0000
committerAlan Modra <amodra@bigpond.net.au>2004-09-16 14:52:12 +0000
commitae97a107b99f70e2165ae00854754c0cc4d9bf1a (patch)
tree6dd9fd34773d0d4f90c7cc6b51dde119b2d3f292 /bfd/elf-m10300.c
parenta1b058adf3d78c6a13eb8621dabf7dd970657dd5 (diff)
downloadbinutils-redhat-ae97a107b99f70e2165ae00854754c0cc4d9bf1a.tar.gz
* 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/elf-m10300.c')
-rw-r--r--bfd/elf-m10300.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index a83015d764..5daf27fc51 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -593,7 +593,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
get_elf_backend_data (abfd)->collect, &bh)))
return FALSE;
h = (struct elf_link_hash_entry *) bh;
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ h->def_regular = 1;
h->type = STT_OBJECT;
if (info->shared
@@ -627,7 +627,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
bed->collect, &bh)))
return FALSE;
h = (struct elf_link_hash_entry *) bh;
- h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ h->def_regular = 1;
h->type = STT_OBJECT;
if (info->shared
@@ -864,7 +864,7 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
|| ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
break;
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ h->needs_plt = 1;
break;
@@ -875,12 +875,12 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
case R_MN10300_PCREL16:
case R_MN10300_PCREL8:
if (h != NULL)
- h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+ h->non_got_ref = 1;
break;
case R_MN10300_32:
if (h != NULL)
- h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+ h->non_got_ref = 1;
/* If we are creating a shared library, then we need to copy
the reloc into the shared library. */
@@ -1470,8 +1470,7 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section,
externally in shared libraries. We can't
do anything with them here. */
|| ((input_section->flags & SEC_DEBUGGING) != 0
- && (h->root.elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))))
+ && h->root.def_dynamic)))))
/* In these cases, we don't need the relocation
value. We check specially because in some
obscure cases sec->output_section will be NULL. */
@@ -4021,31 +4020,28 @@ _bfd_mn10300_elf_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)
{
/* This case can occur if we saw a PLT reloc in an input
file, but the symbol was never referred to by a dynamic
object. In such a case, we don't actually need to build
a procedure linkage table, and we can just do a REL32
reloc instead. */
- BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
+ BFD_ASSERT (h->needs_plt);
return TRUE;
}
@@ -4070,7 +4066,7 @@ _bfd_mn10300_elf_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;
@@ -4121,7 +4117,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
/* If there are no references to this symbol that do not use the
GOT, we don't need to generate a copy reloc. */
- if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
+ if (!h->non_got_ref)
return TRUE;
/* We must allocate the symbol in our .dynbss section, which will
@@ -4148,7 +4144,7 @@ _bfd_mn10300_elf_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
@@ -4445,7 +4441,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
(bfd_byte *) ((Elf32_External_Rela *) srel->contents
+ plt_index));
- 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. */
sym->st_shndx = SHN_UNDEF;
@@ -4474,7 +4470,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
initialized in the relocate_section function. */
if (info->shared
&& (info->symbolic || h->dynindx == -1)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ && h->def_regular)
{
rel.r_info = ELF32_R_INFO (0, R_MN10300_RELATIVE);
rel.r_addend = (h->root.u.def.value
@@ -4494,7 +4490,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
++ srel->reloc_count;
}
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
+ if (h->needs_copy)
{
asection * s;
Elf_Internal_Rela rel;