From 14a793b2f2d16ac51e6ac53e817a60a520a83200 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 11 Oct 2002 08:33:11 +0000 Subject: Fix numerous occurrences of warning: dereferencing type-punned pointer will break strict-aliasing rules --- bfd/elf64-sh64.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'bfd/elf64-sh64.c') diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 7a114c6974e..67a04ad67c2 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -2915,16 +2915,19 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) if (h == NULL) { /* No previous datalabel symbol. Make one. */ + struct bfd_link_hash_entry *bh = NULL; + struct elf_backend_data *bed = get_elf_backend_data (abfd); + if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name, flags, *secp, *valp, *namep, false, - get_elf_backend_data (abfd)->collect, - (struct bfd_link_hash_entry **) &h)) + bed->collect, &bh)) { free (dl_name); return false; } + h = (struct elf_link_hash_entry *) bh; h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF; h->type = STT_DATALABEL; } @@ -3287,13 +3290,15 @@ sh64_elf64_create_dynamic_sections (abfd, info) { /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the .plt section. */ - struct elf_link_hash_entry *h = NULL; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh = NULL; + 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))) + (bfd_vma) 0, (const char *) NULL, false, bed->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; -- cgit v1.2.1