Tidy elf_symbol_from
bfd/ * elf-bfd.h (elf_symbol_from): Remove unused ABFD parameter. * elf.c (ignore_section_sym, _bfd_elf_copy_private_symbol_data), (swap_out_syms): Adjust elf_symbol_from invocation. binutils/ * nm.c (print_symbol): Adjust elf_symbol_from invocation. * objcopy.c (is_hidden_symbol): Likewise. gas/ * config/obj-elf.c (obj_elf_visibility, elf_frob_symbol): Adjust elf_symbol_from invocation. * config/tc-aarch64.c (s_variant_pcs): Likewise. * config/tc-m68hc11.c (s_m68hc11_mark_symbol): Likewise. * config/tc-ppc.c (ppc_elf_localentry, ppc_force_relocation), (ppc_fix_adjustable): Likewise. * config/tc-xgate.c (xgate_frob_symbol): Likewise. ld/ * plugin.c (asymbol_from_plugin_symbol): Adjust elf_symbol_from invocation. opcodes/ * ppc-dis.c (ppc_symbol_is_valid): Adjust elf_symbol_from invocation.
This commit is contained in:
parent
ec74481d7e
commit
c1229f84a4
16 changed files with 47 additions and 20 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2020-09-16 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* elf-bfd.h (elf_symbol_from): Remove unused ABFD parameter.
|
||||||
|
* elf.c (ignore_section_sym, _bfd_elf_copy_private_symbol_data),
|
||||||
|
(swap_out_syms): Adjust elf_symbol_from invocation.
|
||||||
|
|
||||||
2020-09-16 Alan Modra <amodra@gmail.com>
|
2020-09-16 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
PR 26623
|
PR 26623
|
||||||
|
|
|
@ -791,7 +791,7 @@ struct elf_size_info {
|
||||||
(bfd *, const Elf_Internal_Rela *, bfd_byte *);
|
(bfd *, const Elf_Internal_Rela *, bfd_byte *);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define elf_symbol_from(ABFD,S) \
|
#define elf_symbol_from(S) \
|
||||||
((((S)->flags & BSF_SYNTHETIC) == 0 \
|
((((S)->flags & BSF_SYNTHETIC) == 0 \
|
||||||
&& (S)->the_bfd != NULL \
|
&& (S)->the_bfd != NULL \
|
||||||
&& (S)->the_bfd->xvec->flavour == bfd_target_elf_flavour \
|
&& (S)->the_bfd->xvec->flavour == bfd_target_elf_flavour \
|
||||||
|
|
|
@ -4102,7 +4102,7 @@ ignore_section_sym (bfd *abfd, asymbol *sym)
|
||||||
if (sym->section == NULL)
|
if (sym->section == NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
type_ptr = elf_symbol_from (abfd, sym);
|
type_ptr = elf_symbol_from (sym);
|
||||||
return ((type_ptr != NULL
|
return ((type_ptr != NULL
|
||||||
&& type_ptr->internal_elf_sym.st_shndx != 0
|
&& type_ptr->internal_elf_sym.st_shndx != 0
|
||||||
&& bfd_is_abs_section (sym->section))
|
&& bfd_is_abs_section (sym->section))
|
||||||
|
@ -8025,8 +8025,8 @@ _bfd_elf_copy_private_symbol_data (bfd *ibfd,
|
||||||
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
|
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
isym = elf_symbol_from (ibfd, isymarg);
|
isym = elf_symbol_from (isymarg);
|
||||||
osym = elf_symbol_from (obfd, osymarg);
|
osym = elf_symbol_from (osymarg);
|
||||||
|
|
||||||
if (isym != NULL
|
if (isym != NULL
|
||||||
&& isym->internal_elf_sym.st_shndx != 0
|
&& isym->internal_elf_sym.st_shndx != 0
|
||||||
|
@ -8191,7 +8191,7 @@ swap_out_syms (bfd *abfd,
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
type_ptr = elf_symbol_from (abfd, syms[idx]);
|
type_ptr = elf_symbol_from (syms[idx]);
|
||||||
|
|
||||||
if ((flags & BSF_SECTION_SYM) == 0
|
if ((flags & BSF_SECTION_SYM) == 0
|
||||||
&& bfd_is_com_section (syms[idx]->section))
|
&& bfd_is_com_section (syms[idx]->section))
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2020-09-16 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* nm.c (print_symbol): Adjust elf_symbol_from invocation.
|
||||||
|
* objcopy.c (is_hidden_symbol): Likewise.
|
||||||
|
|
||||||
2020-09-15 Nick Clifton <nickc@redhat.com>
|
2020-09-15 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* README-how-to-make-a-release (https): Add a reminder to create a
|
* README-how-to-make-a-release (https): Add a reminder to create a
|
||||||
|
|
|
@ -899,7 +899,7 @@ print_symbol (bfd * abfd,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
info.elfinfo = elf_symbol_from (abfd, sym);
|
info.elfinfo = elf_symbol_from (sym);
|
||||||
info.coffinfo = coff_symbol_from (sym);
|
info.coffinfo = coff_symbol_from (sym);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1443,7 +1443,7 @@ is_hidden_symbol (asymbol *sym)
|
||||||
{
|
{
|
||||||
elf_symbol_type *elf_sym;
|
elf_symbol_type *elf_sym;
|
||||||
|
|
||||||
elf_sym = elf_symbol_from (sym->the_bfd, sym);
|
elf_sym = elf_symbol_from (sym);
|
||||||
if (elf_sym != NULL)
|
if (elf_sym != NULL)
|
||||||
switch (ELF_ST_VISIBILITY (elf_sym->internal_elf_sym.st_other))
|
switch (ELF_ST_VISIBILITY (elf_sym->internal_elf_sym.st_other))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
2020-09-16 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* config/obj-elf.c (obj_elf_visibility, elf_frob_symbol): Adjust
|
||||||
|
elf_symbol_from invocation.
|
||||||
|
* config/tc-aarch64.c (s_variant_pcs): Likewise.
|
||||||
|
* config/tc-m68hc11.c (s_m68hc11_mark_symbol): Likewise.
|
||||||
|
* config/tc-ppc.c (ppc_elf_localentry, ppc_force_relocation),
|
||||||
|
(ppc_fix_adjustable): Likewise.
|
||||||
|
* config/tc-xgate.c (xgate_frob_symbol): Likewise.
|
||||||
|
|
||||||
2020-09-15 H.J. Lu <hongjiu.lu@intel.com>
|
2020-09-15 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* testsuite/gas/cfi/reloc-pe-i386.d: Updated.
|
* testsuite/gas/cfi/reloc-pe-i386.d: Updated.
|
||||||
|
|
|
@ -482,7 +482,7 @@ obj_elf_visibility (int visibility)
|
||||||
symbolP = get_sym_from_input_line_and_check ();
|
symbolP = get_sym_from_input_line_and_check ();
|
||||||
|
|
||||||
bfdsym = symbol_get_bfdsym (symbolP);
|
bfdsym = symbol_get_bfdsym (symbolP);
|
||||||
elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
elfsym = elf_symbol_from (bfdsym);
|
||||||
|
|
||||||
gas_assert (elfsym);
|
gas_assert (elfsym);
|
||||||
|
|
||||||
|
@ -2565,8 +2565,7 @@ elf_frob_symbol (symbolS *symp, int *puntp)
|
||||||
break;
|
break;
|
||||||
case visibility_hidden:
|
case visibility_hidden:
|
||||||
bfdsym = symbol_get_bfdsym (symp);
|
bfdsym = symbol_get_bfdsym (symp);
|
||||||
elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym),
|
elfsym = elf_symbol_from (bfdsym);
|
||||||
bfdsym);
|
|
||||||
elfsym->internal_elf_sym.st_other &= ~3;
|
elfsym->internal_elf_sym.st_other &= ~3;
|
||||||
elfsym->internal_elf_sym.st_other |= STV_HIDDEN;
|
elfsym->internal_elf_sym.st_other |= STV_HIDDEN;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2001,7 +2001,7 @@ s_variant_pcs (int ignored ATTRIBUTE_UNUSED)
|
||||||
restore_line_pointer (c);
|
restore_line_pointer (c);
|
||||||
demand_empty_rest_of_line ();
|
demand_empty_rest_of_line ();
|
||||||
bfdsym = symbol_get_bfdsym (sym);
|
bfdsym = symbol_get_bfdsym (sym);
|
||||||
elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
elfsym = elf_symbol_from (bfdsym);
|
||||||
gas_assert (elfsym);
|
gas_assert (elfsym);
|
||||||
elfsym->internal_elf_sym.st_other |= STO_AARCH64_VARIANT_PCS;
|
elfsym->internal_elf_sym.st_other |= STO_AARCH64_VARIANT_PCS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3766,7 +3766,7 @@ s_m68hc11_mark_symbol (int mark)
|
||||||
SKIP_WHITESPACE ();
|
SKIP_WHITESPACE ();
|
||||||
|
|
||||||
bfdsym = symbol_get_bfdsym (symbolP);
|
bfdsym = symbol_get_bfdsym (symbolP);
|
||||||
elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
elfsym = elf_symbol_from (bfdsym);
|
||||||
|
|
||||||
gas_assert (elfsym);
|
gas_assert (elfsym);
|
||||||
|
|
||||||
|
|
|
@ -2464,7 +2464,7 @@ ppc_elf_localentry (int ignore ATTRIBUTE_UNUSED)
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
bfdsym = symbol_get_bfdsym (sym);
|
bfdsym = symbol_get_bfdsym (sym);
|
||||||
elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
elfsym = elf_symbol_from (bfdsym);
|
||||||
gas_assert (elfsym);
|
gas_assert (elfsym);
|
||||||
elfsym->internal_elf_sym.st_other &= ~STO_PPC64_LOCAL_MASK;
|
elfsym->internal_elf_sym.st_other &= ~STO_PPC64_LOCAL_MASK;
|
||||||
elfsym->internal_elf_sym.st_other |= encoded;
|
elfsym->internal_elf_sym.st_other |= encoded;
|
||||||
|
@ -6161,8 +6161,7 @@ ppc_force_relocation (fixS *fix)
|
||||||
if (fix->fx_addsy)
|
if (fix->fx_addsy)
|
||||||
{
|
{
|
||||||
asymbol *bfdsym = symbol_get_bfdsym (fix->fx_addsy);
|
asymbol *bfdsym = symbol_get_bfdsym (fix->fx_addsy);
|
||||||
elf_symbol_type *elfsym
|
elf_symbol_type *elfsym = elf_symbol_from (bfdsym);
|
||||||
= elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
|
||||||
gas_assert (elfsym);
|
gas_assert (elfsym);
|
||||||
if ((STO_PPC64_LOCAL_MASK & elfsym->internal_elf_sym.st_other) != 0)
|
if ((STO_PPC64_LOCAL_MASK & elfsym->internal_elf_sym.st_other) != 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -6198,8 +6197,7 @@ ppc_fix_adjustable (fixS *fix)
|
||||||
if (fix->fx_addsy)
|
if (fix->fx_addsy)
|
||||||
{
|
{
|
||||||
asymbol *bfdsym = symbol_get_bfdsym (fix->fx_addsy);
|
asymbol *bfdsym = symbol_get_bfdsym (fix->fx_addsy);
|
||||||
elf_symbol_type *elfsym
|
elf_symbol_type *elfsym = elf_symbol_from (bfdsym);
|
||||||
= elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
|
||||||
gas_assert (elfsym);
|
gas_assert (elfsym);
|
||||||
if ((STO_PPC64_LOCAL_MASK & elfsym->internal_elf_sym.st_other) != 0)
|
if ((STO_PPC64_LOCAL_MASK & elfsym->internal_elf_sym.st_other) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1007,7 +1007,7 @@ xgate_frob_symbol (symbolS *sym)
|
||||||
elf_symbol_type *elfsym;
|
elf_symbol_type *elfsym;
|
||||||
|
|
||||||
bfdsym = symbol_get_bfdsym (sym);
|
bfdsym = symbol_get_bfdsym (sym);
|
||||||
elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
elfsym = elf_symbol_from (bfdsym);
|
||||||
|
|
||||||
gas_assert (elfsym);
|
gas_assert (elfsym);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2020-09-16 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* plugin.c (asymbol_from_plugin_symbol): Adjust elf_symbol_from
|
||||||
|
invocation.
|
||||||
|
|
||||||
2020-09-15 H.J. Lu <hongjiu.lu@intel.com>
|
2020-09-15 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* ldelf.c (ldelf_after_open): Check bfd_target_elf_flavour first.
|
* ldelf.c (ldelf_after_open): Check bfd_target_elf_flavour first.
|
||||||
|
|
|
@ -415,7 +415,7 @@ asymbol_from_plugin_symbol (bfd *abfd, asymbol *asym,
|
||||||
|
|
||||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
||||||
{
|
{
|
||||||
elf_symbol_type *elfsym = elf_symbol_from (abfd, asym);
|
elf_symbol_type *elfsym = elf_symbol_from (asym);
|
||||||
unsigned char visibility;
|
unsigned char visibility;
|
||||||
|
|
||||||
if (!elfsym)
|
if (!elfsym)
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2020-09-16 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* ppc-dis.c (ppc_symbol_is_valid): Adjust elf_symbol_from invocation.
|
||||||
|
|
||||||
2020-09-10 Nick Clifton <nickc@redhat.com>
|
2020-09-10 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* ppc-dis.c (ppc_symbol_is_valid): New function. Returns false
|
* ppc-dis.c (ppc_symbol_is_valid): New function. Returns false
|
||||||
|
|
|
@ -408,7 +408,7 @@ ppc_symbol_is_valid (asymbol *sym,
|
||||||
if (sym == NULL)
|
if (sym == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
est = elf_symbol_from (NULL, sym);
|
est = elf_symbol_from (sym);
|
||||||
|
|
||||||
/* Ignore ELF hidden, local, no-type symbols.
|
/* Ignore ELF hidden, local, no-type symbols.
|
||||||
These are generated by annobin. */
|
These are generated by annobin. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue