@@ -2381,7 +2381,7 @@ extern Elf_Internal_Sym *bfd_elf_get_elf_syms
Elf_External_Sym_Shndx *);
extern char * bfd_elf_get_str_section (bfd *, unsigned int);
extern const char *bfd_elf_sym_name
- (bfd *, Elf_Internal_Shdr *, Elf_Internal_Sym *, asection *);
+ (bfd *, Elf_Internal_Shdr *, const Elf_Internal_Sym *, asection *);
extern bool _bfd_elf_copy_private_bfd_data
(bfd *, bfd *) ATTRIBUTE_HIDDEN;
@@ -2405,10 +2405,10 @@ extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
(const struct bfd_link_info *, const asection *,
const Elf_Internal_Rela *) ATTRIBUTE_HIDDEN;
extern bfd_vma _bfd_elf_rela_local_sym
- (bfd *, Elf_Internal_Sym *, asection **, Elf_Internal_Rela *)
+ (bfd *, const Elf_Internal_Sym *, asection **, Elf_Internal_Rela *)
ATTRIBUTE_HIDDEN;
extern bfd_vma _bfd_elf_rel_local_sym
- (bfd *, Elf_Internal_Sym *, asection **, bfd_vma) ATTRIBUTE_HIDDEN;
+ (bfd *, const Elf_Internal_Sym *, asection **, bfd_vma) ATTRIBUTE_HIDDEN;
extern bfd_vma _bfd_elf_section_offset
(bfd *, struct bfd_link_info *, asection *, bfd_vma) ATTRIBUTE_HIDDEN;
@@ -358,7 +358,7 @@ mn10200_elf_relocate_section (struct bfd_link_info *info,
int r_type;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -627,7 +627,7 @@ bfd_elf_get_elf_syms (bfd *ibfd,
static const char *
bfd_elf_sym_name_raw (bfd *abfd,
Elf_Internal_Shdr *symtab_hdr,
- Elf_Internal_Sym *isym)
+ const Elf_Internal_Sym *isym)
{
unsigned int iname = isym->st_name;
unsigned int shindex = symtab_hdr->sh_link;
@@ -646,7 +646,7 @@ bfd_elf_sym_name_raw (bfd *abfd,
const char *
bfd_elf_sym_name (bfd *abfd,
Elf_Internal_Shdr *symtab_hdr,
- Elf_Internal_Sym *isym,
+ const Elf_Internal_Sym *isym,
asection *sym_sec)
{
const char *name = bfd_elf_sym_name_raw (abfd, symtab_hdr, isym);
@@ -13319,7 +13319,7 @@ _bfd_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
bfd_vma
_bfd_elf_rela_local_sym (bfd *abfd,
- Elf_Internal_Sym *sym,
+ const Elf_Internal_Sym *sym,
asection **psec,
Elf_Internal_Rela *rel)
{
@@ -13355,7 +13355,7 @@ _bfd_elf_rela_local_sym (bfd *abfd,
bfd_vma
_bfd_elf_rel_local_sym (bfd *abfd,
- Elf_Internal_Sym *sym,
+ const Elf_Internal_Sym *sym,
asection **psec,
bfd_vma addend)
{
@@ -1468,7 +1468,7 @@ elf_arc_relocate_section (struct bfd_link_info * info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h2;
const char *msg;
@@ -3683,7 +3683,7 @@ elf32_arm_plt_needs_thumb_stub_p (struct bfd_link_info *info,
static struct elf_dyn_relocs **
elf32_arm_get_local_dynreloc_list (bfd *abfd, unsigned long r_symndx,
- Elf_Internal_Sym *isym)
+ const Elf_Internal_Sym *isym)
{
if (ELF32_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
{
@@ -13040,7 +13040,7 @@ elf32_arm_relocate_section (struct bfd_link_info * info,
int r_type;
reloc_howto_type * howto;
unsigned long r_symndx;
- Elf_Internal_Sym * sym;
+ const Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
@@ -15241,7 +15241,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; rel++)
{
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
struct elf_link_hash_entry *h;
struct elf32_arm_link_hash_entry *eh;
unsigned int r_symndx;
@@ -1523,7 +1523,7 @@ elf32_avr_relocate_section (struct bfd_link_info *info, bfd *input_bfd,
unsigned long r_symndx = ELF32_R_SYM (rel->r_info);
reloc_howto_type *howto = elf_avr_howto_table + r_type;
struct elf_link_hash_entry *h = NULL;
- Elf_Internal_Sym *sym = NULL;
+ const Elf_Internal_Sym *sym = NULL;
asection *sec = NULL;
if (r_symndx < symtab_hdr->sh_info)
@@ -1391,7 +1391,7 @@ bfin_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation = 0;
bool unresolved_reloc;
@@ -1355,7 +1355,7 @@ elf32_cr16_relocate_section (struct bfd_link_info *info,
int r_type;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -1013,7 +1013,7 @@ cris_elf_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -849,7 +849,7 @@ elf32_crx_relocate_section (struct bfd_link_info *info,
int r_type;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -2493,7 +2493,7 @@ csky_elf_check_relocs (bfd * abfd,
{
struct elf_link_hash_entry *h;
unsigned long r_symndx;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
int r_type;
r_symndx = ELF32_R_SYM (rel->r_info);
@@ -4303,7 +4303,7 @@ csky_elf_relocate_section (struct bfd_link_info * info,
= (enum elf_csky_reloc_type) ELF32_R_TYPE (rel->r_info);
unsigned long r_symndx;
reloc_howto_type *howto;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation;
bfd_vma off;
@@ -410,7 +410,7 @@ elf32_d10v_relocate_section (struct bfd_link_info *info,
int r_type;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -491,7 +491,7 @@ epiphany_elf_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type * howto;
unsigned long r_symndx;
- Elf_Internal_Sym * sym;
+ const Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
@@ -508,7 +508,7 @@ fr30_elf_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -1322,7 +1322,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
bfd *output_bfd,
struct bfd_link_info *info,
asection *sec,
- Elf_Internal_Sym *sym,
+ const Elf_Internal_Sym *sym,
bfd_vma addend)
{
@@ -2703,7 +2703,7 @@ elf32_frv_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -363,7 +363,7 @@ ft32_elf_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -441,7 +441,7 @@ elf32_h8_relocate_section (struct bfd_link_info *info,
{
unsigned int r_type;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -3560,7 +3560,7 @@ elf32_hppa_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned int r_symndx;
struct elf32_hppa_link_hash_entry *hh;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sym_sec;
bfd_vma relocation;
bfd_reloc_status_type rstatus;
@@ -1064,7 +1064,7 @@ elf_i386_tls_transition (struct bfd_link_info *info, bfd *abfd,
const Elf_Internal_Rela *rel,
const Elf_Internal_Rela *relend,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym,
+ const Elf_Internal_Sym *sym,
bool from_relocate_section)
{
unsigned int from_type = *r_type;
@@ -1571,7 +1571,7 @@ elf_i386_scan_relocs (bfd *abfd,
unsigned int r_symndx;
struct elf_link_hash_entry *h;
struct elf_x86_link_hash_entry *eh;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
const char *name;
bool size_reloc;
bool no_dynreloc;
@@ -2165,7 +2165,7 @@ elf_i386_relocate_section (struct bfd_link_info *info,
unsigned long r_symndx;
struct elf_link_hash_entry *h;
struct elf_x86_link_hash_entry *eh;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma off, offplt, plt_offset;
bfd_vma relocation;
@@ -1407,7 +1407,7 @@ ip2k_elf_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type * howto;
unsigned long r_symndx;
- Elf_Internal_Sym * sym;
+ const Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
@@ -583,7 +583,7 @@ iq2000_elf_relocate_section (struct bfd_link_info * info,
{
reloc_howto_type * howto;
unsigned long r_symndx;
- Elf_Internal_Sym * sym;
+ const Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
@@ -747,7 +747,7 @@ lm32_elf_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned int r_type;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -960,7 +960,7 @@ elf32_m68hc11_relocate_section (struct bfd_link_info *info,
arelent arel;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation = 0;
bfd_reloc_status_type r = bfd_reloc_undefined;
@@ -3459,7 +3459,7 @@ elf_m68k_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation;
bool unresolved_reloc;
@@ -425,7 +425,7 @@ mcore_elf_relocate_section (struct bfd_link_info * info,
asection * sec = NULL;
reloc_howto_type * howto;
bfd_vma relocation;
- Elf_Internal_Sym * sym = NULL;
+ const Elf_Internal_Sym * sym = NULL;
unsigned long r_symndx;
struct elf_link_hash_entry * h = NULL;
unsigned short oldinst = 0;
@@ -449,7 +449,7 @@ mep_elf_relocate_section
{
reloc_howto_type * howto;
unsigned long r_symndx;
- Elf_Internal_Sym * sym;
+ const Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
@@ -1451,7 +1451,7 @@ elf_metag_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_metag_link_hash_entry *hh;
bfd_vma relocation;
@@ -2061,7 +2061,7 @@ elf_metag_check_relocs (bfd *abfd,
{
int r_type;
struct elf_metag_link_hash_entry *hh;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
unsigned long r_symndx;
r_symndx = ELF32_R_SYM (rel->r_info);
@@ -1061,7 +1061,7 @@ microblaze_elf_relocate_section (struct bfd_link_info *info,
bfd_vma addend = rel->r_addend;
bfd_vma offset = rel->r_offset;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
asection *sym_sec;
const char *sym_name;
@@ -219,7 +219,7 @@ moxie_elf_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -1395,7 +1395,7 @@ elf32_msp430_relocate_section (struct bfd_link_info * info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -316,7 +316,7 @@ mt_elf_relocate_section
{
reloc_howto_type * howto;
unsigned long r_symndx;
- Elf_Internal_Sym * sym;
+ const Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
@@ -5114,7 +5114,7 @@ nds32_elf_relocate_section (struct bfd_link_info * info,
reloc_howto_type *howto = NULL;
unsigned long r_symndx;
struct elf_link_hash_entry *h = NULL;
- Elf_Internal_Sym *sym = NULL;
+ const Elf_Internal_Sym *sym = NULL;
asection *sec;
bfd_vma relocation;
bfd_vma relocation_sym = 0xdeadbeef;
@@ -1353,7 +1353,7 @@ or1k_elf_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -2914,7 +2914,7 @@ ppc_elf_check_relocs (bfd *abfd,
unsigned long r_symndx;
enum elf_ppc_reloc_type r_type;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
int tls_type;
struct plt_entry **ifunc;
struct plt_entry **pltent;
@@ -7029,7 +7029,7 @@ ppc_elf_relocate_section (struct bfd_link_info *info,
enum elf_ppc_reloc_type r_type;
bfd_vma addend;
bfd_reloc_status_type r;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
const char *sym_name;
@@ -708,7 +708,7 @@ pru_elf32_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -739,7 +739,7 @@ rl78_elf_relocate_section
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -524,7 +524,7 @@ rx_elf_relocate_section
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -893,7 +893,6 @@ elf_s390_check_relocs (bfd *abfd,
asection *sreloc;
bfd_signed_vma *local_got_refcounts;
int tls_type, old_tls_type;
- Elf_Internal_Sym *isym;
if (bfd_link_relocatable (info))
return true;
@@ -913,6 +912,7 @@ elf_s390_check_relocs (bfd *abfd,
unsigned int r_type;
unsigned int r_symndx;
struct elf_link_hash_entry *h;
+ const Elf_Internal_Sym *isym;
r_symndx = ELF32_R_SYM (rel->r_info);
@@ -2044,7 +2044,7 @@ elf_s390_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma off;
bfd_vma relocation;
@@ -3441,7 +3441,7 @@ sh_elf_relocate_section (struct bfd_link_info *info,
int r_type;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -2165,7 +2165,7 @@ elf32_tic6x_relocate_section (struct bfd_link_info *info,
unsigned long r_symndx;
arelent bfd_reloc;
reloc_howto_type *howto;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma off, off2, relocation;
@@ -2705,7 +2705,7 @@ elf32_tic6x_check_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned int r_type;
unsigned int r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
r_symndx = ELF32_R_SYM (rel->r_info);
r_type = ELF32_R_TYPE (rel->r_info);
@@ -2542,7 +2542,7 @@ tilepro_elf_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
tilepro_create_func create_func;
asection *sec;
bfd_vma relocation;
@@ -2199,7 +2199,7 @@ v850_elf_relocate_section (struct bfd_link_info *info,
unsigned int r_type;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -1226,7 +1226,7 @@ elf_vax_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation;
bfd_reloc_status_type r;
@@ -568,7 +568,7 @@ visium_elf_relocate_section (struct bfd_link_info *info, bfd *input_bfd,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -785,7 +785,7 @@ xstormy16_elf_relocate_section (struct bfd_link_info * info,
{
reloc_howto_type * howto;
unsigned long r_symndx;
- Elf_Internal_Sym * sym;
+ const Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
@@ -2631,7 +2631,7 @@ elf_xtensa_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
char sym_type;
const char *name;
asection *sec;
@@ -405,7 +405,7 @@ z80_elf_relocate_section (struct bfd_link_info *info,
{
unsigned int r_type;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -1807,7 +1807,7 @@ elf64_alpha_sort_relocs_p (asection *sec)
static bool
elf64_alpha_ifunc_p (struct alpha_elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ const Elf_Internal_Sym *sym)
{
if (h != NULL)
return h->root.type == STT_GNU_IFUNC && h->root.def_regular;
@@ -1831,7 +1831,7 @@ elf64_alpha_ifunc_reloc_p (unsigned long r_type)
static bool
elf64_alpha_ifunc_irelplt_p (struct alpha_elf_link_hash_entry *h,
- Elf_Internal_Sym *sym,
+ const Elf_Internal_Sym *sym,
struct bfd_link_info *info)
{
if (!elf64_alpha_ifunc_p (h, sym) || bfd_link_pic (info))
@@ -2114,7 +2114,7 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned long r_symndx, r_type;
struct alpha_elf_link_hash_entry *h;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
unsigned int gotent_flags;
bool maybe_dynamic;
unsigned int need;
@@ -4460,7 +4460,7 @@ elf64_alpha_relocate_section_r (struct bfd_link_info *info ATTRIBUTE_UNUSED,
static const char *
elf64_alpha_sym_name (bfd *abfd, Elf_Internal_Shdr *symtab_hdr,
struct alpha_elf_link_hash_entry *h,
- Elf_Internal_Sym *sym, asection *sec)
+ const Elf_Internal_Sym *sym, asection *sec)
{
if (h != NULL)
return h->root.root.root.string;
@@ -4541,7 +4541,7 @@ elf64_alpha_relocate_section (struct bfd_link_info *info,
bfd_reloc_status_type r;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym = NULL;
+ const Elf_Internal_Sym *sym = NULL;
asection *sec = NULL;
bfd_vma value;
bfd_vma addend;
@@ -194,7 +194,7 @@ bpf_elf_relocate_section (struct bfd_link_info *info,
reloc_howto_type * howto;
unsigned int howto_index;
unsigned long r_symndx;
- Elf_Internal_Sym * sym;
+ const Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h;
bfd_vma relocation;
@@ -3414,7 +3414,7 @@ elf64_ia64_relocate_section (struct bfd_link_info *info,
bfd_reloc_status_type r;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
unsigned int r_type;
bfd_vma value;
asection *sym_sec;
@@ -1374,7 +1374,7 @@ mmix_elf_relocate_section (struct bfd_link_info *info,
{
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -4799,7 +4799,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
{
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
enum elf_ppc64_reloc_type r_type;
int tls_type;
struct _ppc64_elf_section_data *ppc64_sec;
@@ -15563,7 +15563,7 @@ ppc64_elf_relocate_section (struct bfd_link_info *info,
enum elf_ppc64_reloc_type r_type;
bfd_vma addend;
bfd_reloc_status_type r;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h_elf;
struct ppc_link_hash_entry *h;
@@ -925,7 +925,7 @@ elf_s390_check_relocs (bfd *abfd,
unsigned int r_type;
unsigned int r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
r_symndx = ELF64_R_SYM (rel->r_info);
@@ -2334,7 +2334,7 @@ elf_s390_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma off;
bfd_vma relocation;
@@ -1513,7 +1513,7 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd,
const Elf_Internal_Rela *rel,
const Elf_Internal_Rela *relend,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym,
+ const Elf_Internal_Sym *sym,
bool from_relocate_section)
{
unsigned int from_type = *r_type;
@@ -1684,7 +1684,7 @@ elf_x86_64_need_pic (struct bfd_link_info *info,
bfd *input_bfd, asection *sec,
struct elf_link_hash_entry *h,
Elf_Internal_Shdr *symtab_hdr,
- Elf_Internal_Sym *isym,
+ const Elf_Internal_Sym *isym,
reloc_howto_type *howto)
{
const char *v = "";
@@ -2544,7 +2544,7 @@ elf_x86_64_scan_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned int r_symndx;
struct elf_link_hash_entry *h;
struct elf_x86_link_hash_entry *eh;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
const char *name;
bool size_reloc;
bool converted_reloc;
@@ -3209,7 +3209,7 @@ elf_x86_64_relocate_section (struct bfd_link_info *info,
unsigned long r_symndx;
struct elf_link_hash_entry *h;
struct elf_x86_link_hash_entry *eh;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma off, offplt, plt_offset;
bfd_vma relocation;
@@ -5756,7 +5756,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
bool *unresolved_reloc_p,
bool save_addend,
bfd_vma *saved_addend,
- Elf_Internal_Sym *sym)
+ const Elf_Internal_Sym *sym)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned int r_type = howto->type;
@@ -7081,7 +7081,7 @@ elfNN_aarch64_relocate_section (struct bfd_link_info *info,
bfd_reloc_code_real_type relaxed_bfd_r_type;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -7952,11 +7952,11 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; rel++)
{
- struct elf_link_hash_entry *h;
unsigned int r_symndx;
unsigned int r_type;
bfd_reloc_code_real_type bfd_r_type;
- Elf_Internal_Sym *isym;
+ struct elf_link_hash_entry *h;
+ const Elf_Internal_Sym *isym;
r_symndx = ELFNN_R_SYM (rel->r_info);
r_type = ELFNN_R_TYPE (rel->r_info);
@@ -7964,8 +7964,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (r_symndx < symtab_hdr->sh_info)
{
/* A local symbol. */
- isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
- abfd, r_symndx);
+ isym = bfd_sym_from_r_symndx (&htab->root.sym_cache, abfd, r_symndx);
if (isym == NULL)
return false;
@@ -3805,7 +3805,7 @@ elfNN_ia64_relocate_section (struct bfd_link_info *info,
bfd_reloc_status_type r;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
unsigned int r_type;
bfd_vma value;
asection *sym_sec;
@@ -1965,7 +1965,7 @@ elfNN_kvx_final_link_relocate (reloc_howto_type *howto,
bool *unresolved_reloc_p,
bool save_addend,
bfd_vma *saved_addend,
- Elf_Internal_Sym *sym)
+ const Elf_Internal_Sym *sym)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned int r_type = howto->type;
@@ -2454,7 +2454,7 @@ elfNN_kvx_relocate_section (struct bfd_link_info *info,
bfd_reloc_code_real_type bfd_r_type;
reloc_howto_type *howto;
unsigned long r_symndx;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
struct elf_link_hash_entry *h;
bfd_vma relocation;
@@ -3209,11 +3209,11 @@ elfNN_kvx_check_relocs (bfd *abfd, struct bfd_link_info *info,
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; rel++)
{
- struct elf_link_hash_entry *h;
unsigned int r_symndx;
unsigned int r_type;
bfd_reloc_code_real_type bfd_r_type;
- Elf_Internal_Sym *isym;
+ struct elf_link_hash_entry *h;
+ const Elf_Internal_Sym *isym;
r_symndx = ELFNN_R_SYM (rel->r_info);
r_type = ELFNN_R_TYPE (rel->r_info);
@@ -3221,8 +3221,7 @@ elfNN_kvx_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (r_symndx < symtab_hdr->sh_info)
{
/* A local symbol. */
- isym = bfd_sym_from_r_symndx (&htab->sym_cache,
- abfd, r_symndx);
+ isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
if (isym == NULL)
return false;
@@ -1049,7 +1049,7 @@ bad_static_reloc (struct bfd_link_info *info,
bfd *abfd, const Elf_Internal_Rela *rel,
asection *sec, unsigned r_type,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *isym)
+ const Elf_Internal_Sym *isym)
{
reloc_howto_type * r = loongarch_elf_rtype_to_howto (abfd, r_type);
const char *object;
@@ -1145,8 +1145,8 @@ loongarch_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned int r_type;
unsigned int r_symndx;
struct elf_link_hash_entry *h;
+ const Elf_Internal_Sym *isym = NULL;
bool is_abs_symbol = false;
- Elf_Internal_Sym *isym = NULL;
r_symndx = ELFNN_R_SYM (rel->r_info);
r_type = ELFNN_R_TYPE (rel->r_info);
@@ -3248,7 +3248,7 @@ static struct
bfd_vma r_offset;
int r_type;
bfd_vma relocation;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
struct elf_link_hash_entry *h;
bfd_vma addend;
int64_t top_then;
@@ -3258,7 +3258,7 @@ static size_t larch_reloc_queue_tail = 0;
static const char *
loongarch_sym_name (bfd *input_bfd, struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ const Elf_Internal_Sym *sym)
{
const char *ret = NULL;
if (sym)
@@ -3275,7 +3275,7 @@ loongarch_sym_name (bfd *input_bfd, struct elf_link_hash_entry *h,
static void
loongarch_record_one_reloc (bfd *abfd, asection *section, int r_type,
- bfd_vma r_offset, Elf_Internal_Sym *sym,
+ bfd_vma r_offset, const Elf_Internal_Sym *sym,
struct elf_link_hash_entry *h, bfd_vma addend)
{
if ((larch_reloc_queue_head == 0
@@ -3550,7 +3550,7 @@ loongarch_elf_relocate_section (struct bfd_link_info *info,
bfd_vma pc = sec_addr (input_section) + rel->r_offset;
reloc_howto_type *howto = NULL;
asection *sec = NULL;
- Elf_Internal_Sym *sym = NULL;
+ const Elf_Internal_Sym *sym = NULL;
struct elf_link_hash_entry *h = NULL;
const char *name;
bfd_reloc_status_type r = bfd_reloc_ok;
@@ -1064,6 +1064,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned int r_type;
unsigned int r_symndx;
struct elf_link_hash_entry *h;
+ const Elf_Internal_Sym *isym;
bool is_abs_symbol = false;
r_symndx = ELFNN_R_SYM (rel->r_info);
@@ -1072,12 +1073,11 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (r_symndx < symtab_hdr->sh_info)
{
/* A local symbol. */
- Elf_Internal_Sym *isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
- abfd, r_symndx);
+ isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache, abfd, r_symndx);
if (isym == NULL)
return false;
- is_abs_symbol = isym->st_shndx == SHN_ABS ? true : false;
+ is_abs_symbol = isym->st_shndx == SHN_ABS;
/* Check relocation against local STT_GNU_IFUNC symbol. */
if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
@@ -1105,7 +1105,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- is_abs_symbol = bfd_is_abs_symbol (&h->root) ? true : false;
+ is_abs_symbol = bfd_is_abs_symbol (&h->root);
}
if (h != NULL)
@@ -1328,7 +1328,6 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
asection *s;
void *vpp;
- Elf_Internal_Sym *isym;
isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
abfd, r_symndx);
@@ -3077,7 +3076,7 @@ riscv_elf_relocate_section (struct bfd_link_info *info,
{
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation;
bfd_reloc_status_type r = bfd_reloc_ok;
@@ -1375,7 +1375,7 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned int r_symndx;
struct elf_link_hash_entry *h;
struct _bfd_sparc_elf_link_hash_entry *eh;
- Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym;
r_symndx = SPARC_ELF_R_SYMNDX (htab, rel->r_info);
r_type = SPARC_ELF_R_TYPE (rel->r_info);
@@ -2813,7 +2813,7 @@ _bfd_sparc_elf_relocate_section (struct bfd_link_info *info,
unsigned long r_symndx;
struct elf_link_hash_entry *h;
struct _bfd_sparc_elf_link_hash_entry *eh;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
asection *sec;
bfd_vma relocation, off;
bfd_reloc_status_type r;
@@ -2824,7 +2824,7 @@ tilegx_elf_relocate_section (struct bfd_link_info *info,
reloc_howto_type *howto;
unsigned long r_symndx;
struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+ const Elf_Internal_Sym *sym;
tilegx_create_func create_func;
asection *sec;
bfd_vma relocation;
@@ -2180,7 +2180,7 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section,
struct elf_x86_link_hash_table *htab,
const Elf_Internal_Rela *rel,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym,
+ const Elf_Internal_Sym *sym,
Elf_Internal_Shdr *symtab_hdr,
bool *no_dynreloc_p)
{
@@ -3265,7 +3265,7 @@ _bfd_x86_elf_link_fixup_ifunc_symbol (struct bfd_link_info *info,
void
_bfd_x86_elf_link_report_relative_reloc
(struct bfd_link_info *info, asection *asect,
- struct elf_link_hash_entry *h, Elf_Internal_Sym *sym,
+ struct elf_link_hash_entry *h, const Elf_Internal_Sym *sym,
const char *reloc_name, const void *reloc)
{
const char *name;
@@ -3303,7 +3303,7 @@ void
_bfd_x86_elf_link_report_tls_transition_error
(struct bfd_link_info *info, bfd *abfd, asection *asect,
Elf_Internal_Shdr *symtab_hdr, struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym, const Elf_Internal_Rela *rel,
+ const Elf_Internal_Sym *sym, const Elf_Internal_Rela *rel,
const char *from_reloc_name, const char *to_reloc_name,
enum elf_x86_tls_error_type tls_error)
{
@@ -3387,7 +3387,7 @@ _bfd_x86_elf_link_report_tls_transition_error
void
_bfd_x86_elf_link_report_error
(bfd *abfd, asection *sec, Elf_Internal_Shdr *symtab_hdr,
- struct elf_link_hash_entry *h, Elf_Internal_Sym *sym,
+ struct elf_link_hash_entry *h, const Elf_Internal_Sym *sym,
reloc_howto_type *howto, enum elf_x86_error_type type)
{
const char *name;
@@ -887,7 +887,7 @@ extern void _bfd_elf64_write_addend
extern bool _bfd_elf_x86_valid_reloc_p
(asection *, struct bfd_link_info *, struct elf_x86_link_hash_table *,
const Elf_Internal_Rela *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *, Elf_Internal_Shdr *, bool *) ATTRIBUTE_HIDDEN;
+ const Elf_Internal_Sym *, Elf_Internal_Shdr *, bool *) ATTRIBUTE_HIDDEN;
extern bool _bfd_x86_elf_late_size_sections
(struct bfd_link_info *) ATTRIBUTE_HIDDEN;
@@ -949,17 +949,17 @@ extern void _bfd_x86_elf_link_fixup_ifunc_symbol
extern void _bfd_x86_elf_link_report_relative_reloc
(struct bfd_link_info *, asection *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *, const char *, const void *) ATTRIBUTE_HIDDEN;
+ const Elf_Internal_Sym *, const char *, const void *) ATTRIBUTE_HIDDEN;
extern void _bfd_x86_elf_link_report_tls_transition_error
(struct bfd_link_info *, bfd *, asection *, Elf_Internal_Shdr *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *,
+ struct elf_link_hash_entry *, const Elf_Internal_Sym *,
const Elf_Internal_Rela *, const char *, const char *,
enum elf_x86_tls_error_type) ATTRIBUTE_HIDDEN;
extern void _bfd_x86_elf_link_report_error
(bfd *, asection *, Elf_Internal_Shdr *, struct elf_link_hash_entry *,
- Elf_Internal_Sym *, reloc_howto_type *,
+ const Elf_Internal_Sym *, reloc_howto_type *,
enum elf_x86_error_type) ATTRIBUTE_HIDDEN;
extern void _bfd_x86_elf_link_report_relocation_error