NDS32/BFD: Correct an aliasing error in `nds32_elf_check_relocs'
Fix an aliasing build error:
cc1: warnings being treated as errors
.../bfd/elf32-nds32.c: In function 'nds32_elf_check_relocs':
.../bfd/elf32-nds32.c:6644: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: *** [elf32-nds32.lo] Error 1
in a way following commit 6edfbbad08
("Fix up gcc4.1 aliasing
warnings"), <https://sourceware.org/ml/binutils/2005-10/msg00071.html>.
bfd/
* elf32-nds32.c (nds32_elf_check_relocs): Avoid aliasing warning
from GCC.
This commit is contained in:
parent
c48182bfe4
commit
61034b0b6a
|
@ -1,3 +1,8 @@
|
||||||
|
2016-10-18 Maciej W. Rozycki <macro@imgtec.com>
|
||||||
|
|
||||||
|
* elf32-nds32.c (nds32_elf_check_relocs): Avoid aliasing warning
|
||||||
|
from GCC.
|
||||||
|
|
||||||
2016-10-18 Maciej W. Rozycki <macro@imgtec.com>
|
2016-10-18 Maciej W. Rozycki <macro@imgtec.com>
|
||||||
|
|
||||||
* elf32-arm.c (elf32_arm_update_relocs): Rename `index' local
|
* elf32-arm.c (elf32_arm_update_relocs): Rename `index' local
|
||||||
|
|
|
@ -6629,6 +6629,7 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
asection *s;
|
asection *s;
|
||||||
|
void *vpp;
|
||||||
|
|
||||||
Elf_Internal_Sym *isym;
|
Elf_Internal_Sym *isym;
|
||||||
isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
|
isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx);
|
||||||
|
@ -6640,8 +6641,8 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
head = ((struct elf_nds32_dyn_relocs **)
|
vpp = &elf_section_data (s)->local_dynrel;
|
||||||
&elf_section_data (s)->local_dynrel);
|
head = (struct elf_nds32_dyn_relocs **) vpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = *head;
|
p = *head;
|
||||||
|
|
Loading…
Reference in New Issue