This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: aliasing fix for m32r
- From: Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 17 Mar 2004 10:10:22 +0900
- Subject: Re: aliasing fix for m32r
- References: <20040316014859.GJ15900@bubble.modra.org>
Alan Thanks!
Kazuhiro Inaoka
> Fixes "type-punned pointer will break strict-aliasing rules" warning.
>
> * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointer
> aliasing warning. Remove trailing whitespace throughout file.
>
> Index: bfd/elf32-m32r.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf32-m32r.c,v
> retrieving revision 1.39
> diff -u -p -r1.39 elf32-m32r.c
> --- bfd/elf32-m32r.c 19 Dec 2003 11:43:53 -0000 1.39
> +++ bfd/elf32-m32r.c 15 Mar 2004 13:02:05 -0000
> @@ -1730,13 +1730,14 @@ m32r_elf_create_dynamic_sections (abfd,
> {
> /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
> .plt section. */
> - struct elf_link_hash_entry *h = NULL;
> + struct bfd_link_hash_entry *bh = NULL;
> + struct elf_link_hash_entry *h;
> if (! (_bfd_generic_link_add_one_symbol
> (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
> (bfd_vma) 0, (const char *) NULL, FALSE,
> - get_elf_backend_data (abfd)->collect,
> - (struct bfd_link_hash_entry **) &h)))
> + get_elf_backend_data (abfd)->collect, &bh)))
> return FALSE;
> + h = (struct elf_link_hash_entry *) bh;
> h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
> h->type = STT_OBJECT;
>
> --
> Alan Modra
> IBM OzLabs - Linux Technology Centre
>