/* Renesas / SuperH SH specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type sh_elf_ignore_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-static reloc_howto_type *sh_elf_reloc_type_lookup
- (bfd *, bfd_reloc_code_real_type);
-static void sh_elf_info_to_howto
- (bfd *, arelent *, Elf_Internal_Rela *);
-static bfd_boolean sh_elf_set_private_flags
- (bfd *, flagword);
-static bfd_boolean sh_elf_copy_private_data
- (bfd *, bfd *);
-static bfd_boolean sh_elf_merge_private_data
- (bfd *, bfd *);
-static bfd_boolean sh_elf_set_mach_from_flags
- (bfd *);
-static bfd_boolean sh_elf_relax_section
- (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
static bfd_boolean sh_elf_relax_delete_bytes
(bfd *, asection *, bfd_vma, int);
static bfd_boolean sh_elf_align_loads
static bfd_boolean sh_elf_swap_insns
(bfd *, asection *, void *, bfd_byte *, bfd_vma);
#endif
-static bfd_boolean sh_elf_relocate_section
- (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
-static bfd_byte *sh_elf_get_relocated_section_contents
- (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
- bfd_boolean, asymbol **);
-static void sh_elf_copy_indirect_symbol
- (const struct elf_backend_data *, struct elf_link_hash_entry *,
- struct elf_link_hash_entry *);
static int sh_elf_optimized_tls_reloc
(struct bfd_link_info *, int, int);
-static bfd_boolean sh_elf_mkobject
- (bfd *);
-static bfd_boolean sh_elf_object_p
- (bfd *);
-static bfd_boolean sh_elf_check_relocs
- (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
-static struct bfd_hash_entry *sh_elf_link_hash_newfunc
- (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
-static struct bfd_link_hash_table *sh_elf_link_hash_table_create
- (bfd *);
-static bfd_boolean sh_elf_adjust_dynamic_symbol
- (struct bfd_link_info *, struct elf_link_hash_entry *);
-static bfd_boolean sh_elf_size_dynamic_sections
- (bfd *, struct bfd_link_info *);
-static bfd_boolean sh_elf_finish_dynamic_symbol
- (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
-static bfd_boolean sh_elf_finish_dynamic_sections
- (bfd *, struct bfd_link_info *);
-static bfd_reloc_status_type sh_elf_reloc_loop
- (int, bfd *, asection *, bfd_byte *, bfd_vma, asection *, bfd_vma,
- bfd_vma);
-static bfd_boolean create_got_section
- (bfd *, struct bfd_link_info *);
-static bfd_boolean sh_elf_create_dynamic_sections
- (bfd *, struct bfd_link_info *);
static bfd_vma dtpoff_base
(struct bfd_link_info *);
static bfd_vma tpoff
(struct bfd_link_info *, bfd_vma);
-static asection * sh_elf_gc_mark_hook
- (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *);
-static bfd_boolean sh_elf_gc_sweep_hook
- (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
-static bfd_boolean allocate_dynrelocs
- (struct elf_link_hash_entry *, void *);
-static bfd_boolean readonly_dynrelocs
- (struct elf_link_hash_entry *, void *);
-static enum elf_reloc_type_class sh_elf_reloc_type_class
- (const Elf_Internal_Rela *);
-#ifdef INCLUDE_SHMEDIA
-inline static void movi_shori_putval (bfd *, unsigned long, char *);
-#endif
-#if !defined SH_TARGET_ALREADY_DEFINED
-static bfd_boolean elf32_shlin_grok_prstatus
- (bfd *abfd, Elf_Internal_Note *note);
-static bfd_boolean elf32_shlin_grok_psinfo
- (bfd *abfd, Elf_Internal_Note *note);
-#endif
/* The name of the dynamic interpreter. This is put in the .interp
section. */
not if the symbol is in a different section. Besides, we need
a consistent meaning for the relocation, so we just assume here that
the value of the symbol is not available. */
-#if 0
- if (ELF32_R_SYM (irelfn->r_info) < symtab_hdr->sh_info)
- {
- /* If this needs to be changed because of future relaxing,
- it will be handled here like other internal IND12W
- relocs. */
- bfd_put_16 (abfd,
- (bfd_vma) 0xb000 | ((foff >> 1) & 0xfff),
- contents + irel->r_offset);
- }
- else
-#endif
- {
- /* We can't fully resolve this yet, because the external
- symbol value may be changed by future relaxing. We let
- the final link phase handle it. */
- bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset);
- }
+
+ /* We can't fully resolve this yet, because the external
+ symbol value may be changed by future relaxing. We let
+ the final link phase handle it. */
+ bfd_put_16 (abfd, (bfd_vma) 0xb000, contents + irel->r_offset);
+
irel->r_addend = -4;
/* See if there is another R_SH_USES reloc referring to the same
#define elf_sh_plt_reloc_offset(info) (info->shared ? 52 : 44)
inline static void
-movi_shori_putval (bfd *output_bfd, unsigned long value, char *addr)
+movi_shori_putval (bfd *output_bfd, unsigned long value, bfd_byte *addr)
{
bfd_put_32 (output_bfd,
bfd_get_32 (output_bfd, addr)
/* First entry in an absolute procedure linkage table look like this. */
-#if 1
/* Note - this code has been "optimised" not to use r2. r2 is used by
GCC to return the address of large structures, so it should not be
corrupted here. This does mean however, that this PLT does not conform
0, 0, 0, 0 /* 2: replaced with offset into relocation table. */
};
-#else /* These are the old style PLT entries. */
-static const bfd_byte elf_sh_plt0_entry_be[PLT_ENTRY_SIZE] =
-{
- 0xd0, 0x04, /* mov.l 1f,r0 */
- 0xd2, 0x05, /* mov.l 2f,r2 */
- 0x60, 0x02, /* mov.l @r0,r0 */
- 0x62, 0x22, /* mov.l @r2,r2 */
- 0x40, 0x2b, /* jmp @r0 */
- 0xe0, 0x00, /* mov #0,r0 */
- 0x00, 0x09, /* nop */
- 0x00, 0x09, /* nop */
- 0x00, 0x09, /* nop */
- 0x00, 0x09, /* nop */
- 0, 0, 0, 0, /* 1: replaced with address of .got.plt + 8. */
- 0, 0, 0, 0, /* 2: replaced with address of .got.plt + 4. */
-};
-
-static const bfd_byte elf_sh_plt0_entry_le[PLT_ENTRY_SIZE] =
-{
- 0x04, 0xd0, /* mov.l 1f,r0 */
- 0x05, 0xd2, /* mov.l 2f,r2 */
- 0x02, 0x60, /* mov.l @r0,r0 */
- 0x22, 0x62, /* mov.l @r2,r2 */
- 0x2b, 0x40, /* jmp @r0 */
- 0x00, 0xe0, /* mov #0,r0 */
- 0x09, 0x00, /* nop */
- 0x09, 0x00, /* nop */
- 0x09, 0x00, /* nop */
- 0x09, 0x00, /* nop */
- 0, 0, 0, 0, /* 1: replaced with address of .got.plt + 8. */
- 0, 0, 0, 0, /* 2: replaced with address of .got.plt + 4. */
-};
-
-/* Sebsequent entries in an absolute procedure linkage table look like
- this. */
-
-static const bfd_byte elf_sh_plt_entry_be[PLT_ENTRY_SIZE] =
-{
- 0xd0, 0x04, /* mov.l 1f,r0 */
- 0x60, 0x02, /* mov.l @r0,r0 */
- 0xd2, 0x02, /* mov.l 0f,r2 */
- 0x40, 0x2b, /* jmp @r0 */
- 0x60, 0x23, /* mov r2,r0 */
- 0xd1, 0x03, /* mov.l 2f,r1 */
- 0x40, 0x2b, /* jmp @r0 */
- 0x00, 0x09, /* nop */
- 0, 0, 0, 0, /* 0: replaced with address of .PLT0. */
- 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */
- 0, 0, 0, 0, /* 2: replaced with offset into relocation table. */
-};
-
-static const bfd_byte elf_sh_plt_entry_le[PLT_ENTRY_SIZE] =
-{
- 0x04, 0xd0, /* mov.l 1f,r0 */
- 0x02, 0x60, /* mov.l @r0,r0 */
- 0x02, 0xd2, /* mov.l 0f,r2 */
- 0x2b, 0x40, /* jmp @r0 */
- 0x23, 0x60, /* mov r2,r0 */
- 0x03, 0xd1, /* mov.l 2f,r1 */
- 0x2b, 0x40, /* jmp @r0 */
- 0x09, 0x00, /* nop */
- 0, 0, 0, 0, /* 0: replaced with address of .PLT. */
- 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */
- 0, 0, 0, 0, /* 2: replaced with offset into relocation table. */
-};
-
-/* Entries in a PIC procedure linkage table look like this. */
-
-static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] =
-{
- 0xd0, 0x04, /* mov.l 1f,r0 */
- 0x00, 0xce, /* mov.l @(r0,r12),r0 */
- 0x40, 0x2b, /* jmp @r0 */
- 0x00, 0x09, /* nop */
- 0x50, 0xc2, /* 0: mov.l @(8,r12),r0 */
- 0x52, 0xc1, /* 1: mov.l @(4,r12),r2 */
- 0xd1, 0x02, /* mov.l 2f,r1 */
- 0x40, 0x2b, /* jmp @r0 */
- 0xe0, 0x00, /* mov #0,r0 ! shows the type of PLT. */
- 0x00, 0x09, /* nop */
- 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */
- 0, 0, 0, 0 /* 2: replaced with offset into relocation table. */
-};
-
-static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] =
-{
- 0x04, 0xd0, /* mov.l 1f,r0 */
- 0xce, 0x00, /* mov.l @(r0,r12),r0 */
- 0x2b, 0x40, /* jmp @r0 */
- 0x09, 0x00, /* nop */
- 0xc2, 0x50, /* 0: mov.l @(8,r12),r0 */
- 0xc1, 0x52, /* 1: mov.l @(4,r12),r2 */
- 0x02, 0xd1, /* mov.l 2f,r1 */
- 0x2b, 0x40, /* jmp @r0 */
- 0x00, 0xe0, /* mov #0,r0 ! shows the type of PLT. */
- 0x09, 0x00, /* nop */
- 0, 0, 0, 0, /* 1: replaced with address of this symbol in .got. */
- 0, 0, 0, 0 /* 2: replaced with offset into relocation table. */
-};
-#endif /* old style PLT entries. */
-
static const bfd_byte *elf_sh_plt0_entry;
static const bfd_byte *elf_sh_plt_entry;
static const bfd_byte *elf_sh_pic_plt_entry;
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
/* Make sure we know what is going on here. */
BFD_ASSERT (htab->root.dynobj != NULL
- && ((h->elf_link_hash_flags & ELF_LINK_HASH_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->needs_plt
+ || h->u.weakdef != NULL
+ || (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 (h->plt.refcount <= 0
|| SYMBOL_CALLS_LOCAL (info, h)
a procedure linkage table, and we can just do a REL32
reloc instead. */
h->plt.offset = (bfd_vma) -1;
- h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ h->needs_plt = 0;
}
return TRUE;
/* 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->weakdef != NULL)
+ if (h->u.weakdef != NULL)
{
- 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;
+ 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;
if (info->nocopyreloc)
- h->elf_link_hash_flags
- = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
- | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
+ h->non_got_ref = h->u.weakdef->non_got_ref;
return TRUE;
}
/* 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;
/* If -z nocopyreloc was given, we won't generate them either. */
if (info->nocopyreloc)
{
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ h->non_got_ref = 0;
return TRUE;
}
the copy reloc. */
if (p == NULL)
{
- h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
+ h->non_got_ref = 0;
return TRUE;
}
srel = htab->srelbss;
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
eh = (struct elf_sh_link_hash_entry *) h;
if ((h->got.refcount > 0
- || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+ || h->forced_local)
&& eh->gotplt_refcount > 0)
{
/* The symbol has been forced local, or we have some direct got refs,
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
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;
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 = h->plt.offset;
else
{
h->plt.offset = (bfd_vma) -1;
- h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ h->needs_plt = 0;
}
}
else
{
h->plt.offset = (bfd_vma) -1;
- h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
+ h->needs_plt = 0;
}
if (h->got.refcount > 0)
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
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;
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
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;
symbols which turn out to need copy relocs or are not
dynamic. */
- if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
- && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ if (!h->non_got_ref
+ && ((h->def_dynamic
+ && !h->def_regular)
|| (htab->root.dynamic_sections_created
&& (h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_undefined))))
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
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;
&& WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
&& (! info->shared
|| (! info->symbolic && h->dynindx != -1)
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ || !h->def_regular))
/* The cases above are those in which relocation is
overwritten in the switch block below. The cases
below are those in which we must defer relocation
addresses when creating a shared library. */
|| (info->shared
&& ((! info->symbolic && h->dynindx != -1)
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ || !h->def_regular)
&& ((r_type == R_SH_DIR32
- && (h->elf_link_hash_flags
- & ELF_LINK_FORCED_LOCAL) == 0)
+ && !h->forced_local)
|| r_type == R_SH_REL32)
&& ((input_section->flags & SEC_ALLOC) != 0
/* DWARF will emit R_SH_DIR32 relocations in its
in shared libraries. We can't do anything
with them here. */
|| ((input_section->flags & SEC_DEBUGGING) != 0
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
+ && h->def_dynamic)))
/* Dynamic relocs are not propagated for SEC_DEBUGGING
sections because such sections are not SEC_ALLOC and
thus ld.so will not process them. */
|| (sec->output_section == NULL
&& ((input_section->flags & SEC_DEBUGGING) != 0
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
+ && h->def_dynamic))
|| (sec->output_section == NULL
&& (sh_elf_hash_entry (h)->tls_type == GOT_TLS_IE
|| sh_elf_hash_entry (h)->tls_type == GOT_TLS_GD)))
become local. */
if (h == NULL
|| ((info->symbolic || h->dynindx == -1)
- && (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) != 0))
+ && h->def_regular))
{
relocate = TRUE;
outrel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE);
procedure linkage table. */
if (h == NULL
- || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
+ || h->forced_local
|| ! info->shared
|| info->symbolic
|| h->dynindx == -1
if (h == NULL)
goto final_link_relocate;
- if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
+ if (h->forced_local)
goto final_link_relocate;
if (h->plt.offset == (bfd_vma) -1)
tls_type = sh_elf_hash_entry (h)->tls_type;
if (! info->shared
&& (h->dynindx == -1
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ || h->def_regular))
r_type = R_SH_TLS_LE_32;
}
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = (bfd_elf_string_from_elf_section
name = bfd_section_name (input_bfd, sec);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
break;
return 0;
/* SH TLS ABI is variant I and static TLS block start just after tcbhead
structure which has 2 pointer fields. */
- return address - elf_hash_table (info)->tls_sec->vma + 8;
+ return (address - elf_hash_table (info)->tls_sec->vma
+ + align_power ((bfd_vma) 8,
+ elf_hash_table (info)->tls_sec->alignment_power));
}
static asection *
struct elf_sh_dyn_relocs *p;
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-#ifdef INCLUDE_SHMEDIA
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
{
+#ifdef INCLUDE_SHMEDIA
seen_stt_datalabel |= h->type == STT_DATALABEL;
+#endif
h = (struct elf_link_hash_entry *) h->root.u.i.link;
}
-#endif
eh = (struct elf_sh_link_hash_entry *) h;
for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
if (p->sec == sec)
}
if (ind->root.type != bfd_link_hash_indirect
- && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
- /* If called to transfer flags for a weakdef during processing
- of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
- We clear it ourselves for ELIMINATE_COPY_RELOCS. */
- dir->elf_link_hash_flags |=
- (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK
- | ELF_LINK_HASH_NEEDS_PLT));
+ && dir->dynamic_adjusted)
+ {
+ /* If called to transfer flags for a weakdef during processing
+ of elf_adjust_dynamic_symbol, don't copy non_got_ref.
+ We clear it ourselves for ELIMINATE_COPY_RELOCS. */
+ dir->ref_dynamic |= ind->ref_dynamic;
+ dir->ref_regular |= ind->ref_regular;
+ dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
+ dir->needs_plt |= ind->needs_plt;
+ }
else
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
}
&& h->root.type != bfd_link_hash_undefined
&& h->root.type != bfd_link_hash_undefweak
&& (h->dynindx == -1
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ || h->def_regular))
r_type = R_SH_TLS_LE_32;
/* Some relocs require a global offset table. */
creating a procedure linkage table entry. */
if (h == NULL
- || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
+ || h->forced_local
|| ! info->shared
|| info->symbolic
|| h->dynindx == -1)
goto force_got;
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ h->needs_plt = 1;
h->plt.refcount += 1;
((struct elf_sh_link_hash_entry *) h)->gotplt_refcount += 1;
if (h == NULL)
continue;
- if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
+ if (h->forced_local)
break;
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
+ h->needs_plt = 1;
h->plt.refcount += 1;
break;
#endif
if (h != NULL && ! info->shared)
{
- h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+ h->non_got_ref = 1;
h->plt.refcount += 1;
}
|| (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))))
|| (! info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0)))
+ || !h->def_regular)))
{
struct elf_sh_dyn_relocs *p;
struct elf_sh_dyn_relocs **head;
loc = srel->contents + plt_index * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &rel, 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. */
}
#endif
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
+ if (h->needs_copy)
{
asection *s;
Elf_Internal_Rela rel;