};
typedef asection * (*elf_gc_mark_hook_fn)
- (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *);
+ (asection *, struct bfd_link_info *, struct elf_reloc_cookie *,
+ struct elf_link_hash_entry *, unsigned int);
enum elf_property_kind
{
(bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
extern asection *_bfd_elf_gc_mark_hook
- (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *);
+ (asection *, struct bfd_link_info *, struct elf_reloc_cookie *,
+ struct elf_link_hash_entry *, unsigned int);
extern asection *_bfd_elf_gc_mark_rsec
(struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
static asection *
mn10300_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_MN10300_GNU_VTINHERIT:
case R_MN10300_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Perform a relocation as part of a final link. */
static asection *
elf32_arm_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_ARM_GNU_VTINHERIT:
case R_ARM_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Look through the relocs for a section during the first phase. */
}
static asection *
-bfin_gc_mark_hook (asection * sec,
+bfin_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela * rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym * sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_BFIN_GNU_VTINHERIT:
case R_BFIN_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
\f
extern const bfd_target bfin_elf32_fdpic_vec;
return false;
}
-static asection *
-elf32_cr16_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
-{
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
-}
-
/* Create dynamic sections when linking against a dynamic object. */
static bool
#define bfd_elf32_bfd_relax_section elf32_cr16_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \
elf32_cr16_get_relocated_section_contents
-#define elf_backend_gc_mark_hook elf32_cr16_gc_mark_hook
#define elf_backend_can_gc_sections 1
#define elf_backend_rela_normal 1
#define elf_backend_check_relocs cr16_elf_check_relocs
static asection *
cris_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
- enum elf_cris_reloc_type r_type = ELF32_R_TYPE (rel->r_info);
+ enum elf_cris_reloc_type r_type = ELF32_R_TYPE (cookie->rel->r_info);
if (h != NULL)
switch (r_type)
{
break;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* The elf_backend_plt_sym_val hook function. */
static asection *
csky_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
{
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_CKCORE_GNU_VTINHERIT:
case R_CKCORE_GNU_VTENTRY:
}
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Match symbol names created by tc-csky.c:make_mapping_symbol. */
static asection *
elf32_d10v_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_D10V_GNU_VTINHERIT:
case R_D10V_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Look through the relocs for a section during the first phase.
static asection *
fr30_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_FR30_GNU_VTINHERIT:
case R_FR30_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Look through the relocs for a section during the first phase.
static asection *
elf32_frv_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_FRV_GNU_VTINHERIT:
case R_FRV_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
\f
/* Hook called by the linker routine which adds symbols from an object
static asection *
elf32_hppa_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rela,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *hh,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (hh != NULL)
- switch ((unsigned int) ELF32_R_TYPE (rela->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_PARISC_GNU_VTINHERIT:
case R_PARISC_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rela, hh, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, hh, symndx);
}
/* Support for core dump NOTE sections. */
static asection *
iq2000_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_IQ2000_GNU_VTINHERIT:
case R_IQ2000_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
\f
static asection *
lm32_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_LM32_GNU_VTINHERIT:
case R_LM32_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Look through the relocs for a section during the first phase. */
static asection *
m32r_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_M32R_GNU_VTINHERIT:
case R_M32R_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Look through the relocs for a section during the first phase.
static asection *
elf_m68k_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_68K_GNU_VTINHERIT:
case R_68K_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
\f
/* Return the type of PLT associated with OUTPUT_BFD. */
static asection *
mcore_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_MCORE_GNU_VTINHERIT:
case R_MCORE_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Look through the relocs for a section during the first phase.
static asection *
elf_metag_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rela,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *hh,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (hh != NULL)
- switch ((unsigned int) ELF32_R_TYPE (rela->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_METAG_GNU_VTINHERIT:
case R_METAG_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rela, hh, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, hh, symndx);
}
/* Determine the type of stub needed, if any, for a call. */
static asection *
microblaze_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info * info,
- Elf_Internal_Rela * rel,
- struct elf_link_hash_entry * h,
- Elf_Internal_Sym * sym)
+ struct bfd_link_info *info,
+ struct elf_reloc_cookie *cookie,
+ struct elf_link_hash_entry *h,
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_MICROBLAZE_GNU_VTINHERIT:
case R_MICROBLAZE_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* PIC support. */
return true;
}
\f
-/* Return the section that should be marked against GC for a given
- relocation. */
-
-static asection *
-moxie_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
-{
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
-}
-
/* Look through the relocs for a section during the first phase.
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto moxie_info_to_howto_rela
#define elf_backend_relocate_section moxie_elf_relocate_section
-#define elf_backend_gc_mark_hook moxie_elf_gc_mark_hook
#define elf_backend_check_relocs moxie_elf_check_relocs
#define elf_backend_can_gc_sections 1
static asection *
nds32_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info,
- Elf_Internal_Rela *rel, struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct elf_reloc_cookie *cookie,
+ struct elf_link_hash_entry *h,
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_NDS32_GNU_VTINHERIT:
case R_NDS32_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
static enum elf_nds32_tls_type
static asection *
or1k_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_OR1K_GNU_VTINHERIT:
case R_OR1K_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Look through the relocs for a section during the first phase. */
static asection *
ppc_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_PPC_GNU_VTINHERIT:
case R_PPC_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
static bool
static asection *
elf_s390_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_390_GNU_VTINHERIT:
case R_390_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
-
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Make sure we emit a GOT entry if the symbol was supposed to have a PLT
static asection *
s3_bfd_score_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_SCORE_GNU_VTINHERIT:
case R_SCORE_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Support for core dump NOTE sections. */
static asection *
_bfd_score_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (bfd_get_mach (info->input_bfds) == bfd_mach_score3)
- return s3_bfd_score_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return s3_bfd_score_elf_gc_mark_hook (sec, info, cookie, h, symndx);
else
- return s7_bfd_score_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return s7_bfd_score_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
static bool
extern asection *
s7_bfd_score_elf_gc_mark_hook (asection *,
struct bfd_link_info *,
- Elf_Internal_Rela *,
+ struct elf_reloc_cookie *,
struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
+ unsigned int);
extern bool
s7_bfd_score_elf_grok_prstatus (bfd *, Elf_Internal_Note *);
asection *
s7_bfd_score_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_SCORE_GNU_VTINHERIT:
case R_SCORE_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Support for core dump NOTE sections. */
static asection *
sh_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_SH_GNU_VTINHERIT:
case R_SH_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static asection *
tilepro_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
{
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_TILEPRO_GNU_VTINHERIT:
case R_TILEPRO_GNU_VTENTRY:
{
struct bfd_link_hash_entry *bh;
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_TILEPRO_TLS_GD_CALL:
/* This reloc implicitly references __tls_get_addr. We know
h->mark = 1;
if (h->is_weakalias)
weakdef (h)->mark = 1;
- sym = NULL;
+ symndx = 0;
}
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Adjust a symbol defined by a dynamic object and referenced by a
static asection *
v850_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_V850_GNU_VTINHERIT:
case R_V850_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
static void
static asection *
elf_vax_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_VAX_GNU_VTINHERIT:
case R_VAX_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Adjust a symbol defined by a dynamic object and referenced by a
static asection *
visium_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info,
- Elf_Internal_Rela *rel, struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct elf_reloc_cookie *cookie,
+ struct elf_link_hash_entry *h,
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_VISIUM_GNU_VTINHERIT:
case R_VISIUM_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
static bool
static asection *
xstormy16_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_XSTORMY16_GNU_VTINHERIT:
case R_XSTORMY16_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
\f
#define ELF_ARCH bfd_arch_xstormy16
static asection *
elf_xtensa_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
/* Property sections are marked "KEEP" in the linker scripts, but they
should not cause other sections to be marked. (This approach relies
return NULL;
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_XTENSA_GNU_VTINHERIT:
case R_XTENSA_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
static asection *
elf64_alpha_gc_mark_hook (asection *sec, struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)
+ struct elf_reloc_cookie *cookie,
+ struct elf_link_hash_entry *h, unsigned int symndx)
{
/* These relocations don't really reference a symbol. Instead we store
extra data in their addend slot. Ignore the symbol. */
- switch (ELF64_R_TYPE (rel->r_info))
+ switch (ELF64_R_TYPE (cookie->rel->r_info))
{
case R_ALPHA_LITUSE:
case R_ALPHA_GPDISP:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Adjust a symbol defined by a dynamic object and referenced by a
static asection *
mmix_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF64_R_TYPE (rel->r_info))
+ switch (ELF64_R_TYPE (cookie->rel->r_info))
{
case R_MMIX_GNU_VTINHERIT:
case R_MMIX_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
\f
/* Sort register relocs to come before expanding relocs. */
static asection *
ppc64_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
asection *rsec;
enum elf_ppc64_reloc_type r_type;
struct ppc_link_hash_entry *eh, *fh, *fdh;
- r_type = ELF64_R_TYPE (rel->r_info);
+ r_type = ELF64_R_TYPE (cookie->rel->r_info);
switch (r_type)
{
case R_PPC64_GNU_VTINHERIT:
break;
default:
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
}
}
else
{
struct _opd_sec_data *opd;
+ Elf_Internal_Sym *sym = &cookie->locsyms[symndx];
rsec = bfd_section_from_elf_index (sec->owner, sym->st_shndx);
opd = get_opd_info (rsec);
{
rsec->gc_mark = 1;
- rsec = opd->func_sec[OPD_NDX (sym->st_value + rel->r_addend)];
+ rsec = opd->func_sec[OPD_NDX (sym->st_value + cookie->rel->r_addend)];
}
}
static asection *
elf_s390_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELF64_R_TYPE (rel->r_info))
+ switch (ELF64_R_TYPE (cookie->rel->r_info))
{
case R_390_GNU_VTINHERIT:
case R_390_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Make sure we emit a GOT entry if the symbol was supposed to have a PLT
asection *
_bfd_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
- Elf_Internal_Rela *rel ATTRIBUTE_UNUSED,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h == NULL)
- return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+ {
+ Elf_Internal_Sym *sym = &cookie->locsyms[symndx];
+ return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+ }
switch (h->root.type)
{
static asection *
elf_gc_mark_debug_section (asection *sec ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED,
- Elf_Internal_Rela *rel ATTRIBUTE_UNUSED,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
{
else
{
/* Return the local debug definition section. */
+ Elf_Internal_Sym *sym = &cookie->locsyms[symndx];
asection *isec = bfd_section_from_elf_index (sec->owner,
sym->st_shndx);
if (isec != NULL && (isec->flags & SEC_DEBUGGING) != 0)
if (r_symndx >= cookie->locsymcount)
return NULL;
- return (*gc_mark_hook) (sec, info, cookie->rel, NULL,
- &cookie->locsyms[r_symndx]);
+ return (*gc_mark_hook) (sec, info, cookie, NULL, r_symndx);
}
bool was_marked = h->mark;
}
}
- return (*gc_mark_hook) (sec, info, cookie->rel, h, NULL);
+ return (*gc_mark_hook) (sec, info, cookie, h, 0);
}
/* COOKIE->rel describes a relocation against section SEC, which is
static asection *
loongarch_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (ELFNN_R_TYPE (rel->r_info))
+ switch (ELFNN_R_TYPE (cookie->rel->r_info))
{
case R_LARCH_GNU_VTINHERIT:
case R_LARCH_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Return TRUE if symbol H should be hashed in the `.gnu.hash' section. For
asection *
_bfd_mips_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
/* ??? Do mips16 stub sections need to be handled special? */
if (h != NULL)
- switch (ELF_R_TYPE (sec->owner, rel->r_info))
+ switch (ELF_R_TYPE (sec->owner, cookie->rel->r_info))
{
case R_MIPS_GNU_VTINHERIT:
case R_MIPS_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Prevent .MIPS.abiflags from being discarded with --gc-sections. */
extern bool _bfd_mips_elf_modify_segment_map
(bfd *, struct bfd_link_info *);
extern asection * _bfd_mips_elf_gc_mark_hook
- (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *);
+ (asection *, struct bfd_link_info *, struct elf_reloc_cookie *,
+ struct elf_link_hash_entry *, unsigned int);
extern void _bfd_mips_elf_copy_indirect_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *);
asection *
_bfd_sparc_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
- switch (SPARC_ELF_R_TYPE (rel->r_info))
+ switch (SPARC_ELF_R_TYPE (cookie->rel->r_info))
{
case R_SPARC_GNU_VTINHERIT:
case R_SPARC_GNU_VTENTRY:
if (!bfd_link_executable (info))
{
- switch (SPARC_ELF_R_TYPE (rel->r_info))
+ switch (SPARC_ELF_R_TYPE (cookie->rel->r_info))
{
case R_SPARC_TLS_GD_CALL:
case R_SPARC_TLS_LDM_CALL:
h->mark = 1;
if (h->is_weakalias)
weakdef (h)->mark = 1;
- sym = NULL;
+ symndx = 0;
}
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
static Elf_Internal_Rela *
(bfd *, struct bfd_link_info *,
asection *, const Elf_Internal_Rela *);
extern asection *_bfd_sparc_elf_gc_mark_hook
- (asection *, struct bfd_link_info *,
- Elf_Internal_Rela *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
+ (asection *, struct bfd_link_info *, struct elf_reloc_cookie *,
+ struct elf_link_hash_entry *, unsigned int);
extern bool _bfd_sparc_elf_adjust_dynamic_symbol
(struct bfd_link_info *, struct elf_link_hash_entry *);
extern bool _bfd_sparc_elf_omit_section_dynsym
asection *
tilegx_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
if (h != NULL)
{
- switch (TILEGX_ELF_R_TYPE (rel->r_info))
+ switch (TILEGX_ELF_R_TYPE (cookie->rel->r_info))
{
case R_TILEGX_GNU_VTINHERIT:
case R_TILEGX_GNU_VTENTRY:
{
struct bfd_link_hash_entry *bh;
- switch (TILEGX_ELF_R_TYPE (rel->r_info))
+ switch (TILEGX_ELF_R_TYPE (cookie->rel->r_info))
{
case R_TILEGX_TLS_GD_CALL:
/* This reloc implicitly references __tls_get_addr. We know
h->mark = 1;
if (h->is_weakalias)
weakdef (h)->mark = 1;
- sym = NULL;
+ symndx = 0;
}
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
/* Adjust a symbol defined by a dynamic object and referenced by a
extern asection *
tilegx_elf_gc_mark_hook (asection *,
struct bfd_link_info *,
- Elf_Internal_Rela *,
+ struct elf_reloc_cookie *,
struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
+ unsigned int);
extern bfd_vma
tilegx_elf_plt_sym_val (bfd_vma, const asection *, const arelent *);
asection *
_bfd_x86_elf_gc_mark_hook (asection *sec,
struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
+ struct elf_reloc_cookie *cookie,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ unsigned int symndx)
{
/* Compiler should optimize this out. */
if (((unsigned int) R_X86_64_GNU_VTINHERIT
abort ();
if (h != NULL)
- switch (ELF32_R_TYPE (rel->r_info))
+ switch (ELF32_R_TYPE (cookie->rel->r_info))
{
case R_X86_64_GNU_VTINHERIT:
case R_X86_64_GNU_VTENTRY:
return NULL;
}
- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
+ return _bfd_elf_gc_mark_hook (sec, info, cookie, h, symndx);
}
static bfd_vma
(struct bfd_link_info *, struct elf_link_hash_entry *) ATTRIBUTE_HIDDEN;
extern asection * _bfd_x86_elf_gc_mark_hook
- (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *) ATTRIBUTE_HIDDEN;
+ (asection *, struct bfd_link_info *, struct elf_reloc_cookie *,
+ struct elf_link_hash_entry *, unsigned int) ATTRIBUTE_HIDDEN;
extern long _bfd_x86_elf_get_synthetic_symtab
(bfd *, long, long, bfd_vma, struct elf_x86_plt [], asymbol **,