@@ -3696,9 +3696,7 @@ elf32_arm_get_local_dynreloc_list (bfd *abfd, unsigned long r_symndx,
}
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
@@ -2602,18 +2602,11 @@ csky_elf_check_relocs (bfd * abfd,
}
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
void **vpp;
asection *s;
- Elf_Internal_Sym *loc_isym;
- loc_isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
- abfd, r_symndx);
- if (loc_isym == NULL)
- return false;
- s = bfd_section_from_elf_index (abfd, loc_isym->st_shndx);
+ s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
s = sec;
vpp = &elf_section_data (s)->local_dynrel;
@@ -1454,9 +1454,7 @@ elf32_hppa_check_relocs (bfd *abfd,
}
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
asection *sr;
void *vpp;
Elf_Internal_Sym *isym;
@@ -1948,17 +1948,10 @@ elf_i386_scan_relocs (bfd *abfd,
}
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
void **vpp;
asection *s;
- isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
- goto error_return;
-
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
s = sec;
@@ -2657,10 +2657,7 @@ microblaze_elf_check_relocs (bfd * abfd,
head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
Elf_Internal_Sym *isym;
void *vpp;
@@ -2232,10 +2232,7 @@ or1k_elf_check_relocs (bfd *abfd,
head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
Elf_Internal_Sym *isym;
void *vpp;
@@ -3472,9 +3472,7 @@ ppc_elf_check_relocs (bfd *abfd,
}
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
struct ppc_dyn_relocs *p;
struct ppc_dyn_relocs **rel_head;
bool is_ifunc;
@@ -912,7 +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;
+ const Elf_Internal_Sym *isym = NULL;
r_symndx = ELF32_R_SYM (rel->r_info);
@@ -1263,22 +1263,13 @@ elf_s390_check_relocs (bfd *abfd,
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- {
- head = &h->dyn_relocs;
- }
+ head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
- isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
- return false;
-
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
s = sec;
@@ -2855,9 +2855,7 @@ elf32_tic6x_check_relocs (bfd *abfd, struct bfd_link_info *info,
}
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
void **vpp;
asection *s;
@@ -1711,10 +1711,7 @@ tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
Elf_Internal_Sym *isym;
@@ -925,7 +925,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;
+ const Elf_Internal_Sym *isym = NULL;
r_symndx = ELF64_R_SYM (rel->r_info);
@@ -1328,22 +1328,13 @@ elf_s390_check_relocs (bfd *abfd,
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- {
- head = &h->dyn_relocs;
- }
+ head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
- isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
- return false;
-
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
s = sec;
@@ -3015,17 +3015,10 @@ need_got:
head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void **vpp;
- isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
- goto error_return;
-
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
s = sec;
@@ -7956,7 +7956,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned int r_type;
bfd_reloc_code_real_type bfd_r_type;
struct elf_link_hash_entry *h;
- const Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym = NULL;
r_symndx = ELFNN_R_SYM (rel->r_info);
r_type = ELFNN_R_TYPE (rel->r_info);
@@ -8181,23 +8181,13 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* If this is a global symbol, we count the number of
relocations we need for this symbol. */
if (h != NULL)
- {
- head = &h->dyn_relocs;
- }
+ head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void **vpp;
- isym = bfd_sym_from_r_symndx (&htab->root.sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
- return false;
-
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
s = sec;
@@ -3213,7 +3213,7 @@ elfNN_kvx_check_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned int r_type;
bfd_reloc_code_real_type bfd_r_type;
struct elf_link_hash_entry *h;
- const Elf_Internal_Sym *isym;
+ const Elf_Internal_Sym *isym = NULL;
r_symndx = ELFNN_R_SYM (rel->r_info);
r_type = ELFNN_R_TYPE (rel->r_info);
@@ -3318,18 +3318,10 @@ elfNN_kvx_check_relocs (bfd *abfd, struct bfd_link_info *info,
}
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void **vpp;
- isym = bfd_sym_from_r_symndx (&htab->sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
- return false;
-
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
s = sec;
@@ -1529,10 +1529,7 @@ loongarch_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
@@ -1064,7 +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;
+ const Elf_Internal_Sym *isym = NULL;
bool is_abs_symbol = false;
r_symndx = ELFNN_R_SYM (rel->r_info);
@@ -1322,18 +1322,10 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
- isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
- abfd, r_symndx);
- if (isym == NULL)
- return false;
-
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
s = sec;
@@ -1761,9 +1761,7 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
@@ -1958,10 +1958,7 @@ tilegx_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
head = &h->dyn_relocs;
else
{
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
+ /* Track dynamic relocs needed for local syms too. */
asection *s;
void *vpp;
Elf_Internal_Sym *isym;