aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-08-31 23:45:46 +0000
committerDJ Delorie <dj@redhat.com>2005-08-31 23:45:46 +0000
commite81d3500e7844b11a96a65411d11469706c40e70 (patch)
tree86a972ce3365d1a353b9a040b675ab9a699abab1 /bfd/elf32-i386.c
parentcb2f3a2924275eb32ef1d02a5b7070c450592fd5 (diff)
downloadgdb-e81d3500e7844b11a96a65411d11469706c40e70.zip
gdb-e81d3500e7844b11a96a65411d11469706c40e70.tar.gz
gdb-e81d3500e7844b11a96a65411d11469706c40e70.tar.bz2
* elf32-i386.c (elf_i386_check_relocs): Don't cast a unary &
address operator, as that breaks GCC's strict aliasing rules. (elf_i386_size_dynamic_sections): Avoid the need for type punning. * elf64-x86-64.c (elf_x86_64_check_relocs): Don't cast a unary & address operator, as that breaks GCC's strict aliasing rules. (elf_x86_64_size_dynamic_sections): Avoid the need for type punning.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 78c4fa3..acb9f19 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1165,6 +1165,7 @@ elf_i386_check_relocs (bfd *abfd,
}
else
{
+ void **vpp;
/* Track dynamic relocs needed for local syms too.
We really need local syms available to do this
easily. Oh well. */
@@ -1175,8 +1176,8 @@ elf_i386_check_relocs (bfd *abfd,
if (s == NULL)
return FALSE;
- head = ((struct elf_i386_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf_i386_dyn_relocs **)vpp;
}
p = *head;
@@ -1823,8 +1824,8 @@ elf_i386_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
{
struct elf_i386_dyn_relocs *p;
- for (p = *((struct elf_i386_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ for (p = ((struct elf_i386_dyn_relocs *)
+ elf_section_data (s)->local_dynrel);
p != NULL;
p = p->next)
{