diff options
author | Alan Modra <amodra@gmail.com> | 2002-10-11 08:33:11 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-10-11 08:33:11 +0000 |
commit | 14a793b2f2d16ac51e6ac53e817a60a520a83200 (patch) | |
tree | f61585eba76e731da279ee2a157c23c0496c0354 /bfd/elf32-m32r.c | |
parent | 2d801b0fa01bf6af6d34f000ab55096ff1064acc (diff) | |
download | gdb-14a793b2f2d16ac51e6ac53e817a60a520a83200.zip gdb-14a793b2f2d16ac51e6ac53e817a60a520a83200.tar.gz gdb-14a793b2f2d16ac51e6ac53e817a60a520a83200.tar.bz2 |
Fix numerous occurrences of
warning: dereferencing type-punned pointer will break strict-aliasing rules
Diffstat (limited to 'bfd/elf32-m32r.c')
-rw-r--r-- | bfd/elf32-m32r.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index a2e9e0b..8adb1e2 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -847,6 +847,7 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) section already exists a new one is created that follows it which screws of _SDA_BASE_ address calcs because output_offset != 0. */ struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; asection *s = bfd_get_section_by_name (abfd, ".sdata"); /* The following code was cobbled from elf32-ppc.c and elflink.c. */ @@ -863,10 +864,10 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd_set_section_alignment (abfd, s, 2); } - h = (struct elf_link_hash_entry *) - bfd_link_hash_lookup (info->hash, "_SDA_BASE_", false, false, false); + bh = bfd_link_hash_lookup (info->hash, "_SDA_BASE_", + false, false, false); - if ((h == NULL || h->root.type == bfd_link_hash_undefined) + if ((bh == NULL || bh->type == bfd_link_hash_undefined) && !(_bfd_generic_link_add_one_symbol (info, abfd, "_SDA_BASE_", @@ -876,8 +877,9 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) (const char *) NULL, false, get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h))) + &bh))) return false; + h = (struct elf_link_hash_entry *) bh; h->type = STT_OBJECT; } |