From 2a5d549bf83b5ec2d589bd3685c7ce5d655778c9 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 4 Nov 2003 10:45:54 +0000 Subject: [PATCH] * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix "dereferencing type-punned pointer" warnings. --- bfd/ChangeLog | 11 +++++++---- bfd/elf-m10300.c | 12 +++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 835a8af65..1bd4d56e0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ 2003-11-04 Alan Modra + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix + "dereferencing type-punned pointer" warnings. + * aout-adobe.c (aout_adobe_set_section_contents): Constify location. * aoutx.h (NAME(aout,set_section_contents)): Ditto. * bfd-in2.h: Regenerate. @@ -119,7 +122,7 @@ * section.c (bfd_set_section_contents): Make the "location" buffer constant. * bfd-in2.h: Re-generate. - + 2003-10-30 Andrew Cagney * syms.c: Replace "struct symbol_cache_entry" with "struct @@ -200,8 +203,8 @@ 2003-10-29 Daniel Jacobowitz - * elf32-arm.h (elf32_arm_final_link_relocate): Move check for - SEC_ALLOC. + * elf32-arm.h (elf32_arm_final_link_relocate): Move check for + SEC_ALLOC. 2003-10-29 Philip Blundell @@ -220,7 +223,7 @@ (elf32_arm_check_relocs): Likewise. (elf32_arm_adjust_dynamic_symbol): Likewise. (elf32_arm_copy_indirect_symbol): New. - (elf32_arm_link_hash_table_create): Initialise new fields. + (elf32_arm_link_hash_table_create): Initialise new fields. (elf32_arm_gc_sweep_hook): Implement. (elf32_arm_discard_copies): Delete. (elf32_arm_finish_dynamic_symbol): Use new PLT code. diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 95005739f..19ba0d2ba 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -561,6 +561,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info) flagword flags; flagword pltflags; asection * s; + struct bfd_link_hash_entry * bh; struct elf_link_hash_entry * h; const struct elf_backend_data * bed = get_elf_backend_data (abfd); int ptralign; @@ -604,13 +605,13 @@ _bfd_mn10300_elf_create_got_section (abfd, info) { /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the .plt section. */ - struct elf_link_hash_entry *h = NULL; + 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))) + 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; @@ -638,12 +639,13 @@ _bfd_mn10300_elf_create_got_section (abfd, info) (or .got.plt) section. We don't do this in the linker script because we don't want to define the symbol if we are not creating a global offset table. */ - h = NULL; + bh = NULL; if (!(_bfd_generic_link_add_one_symbol (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, bed->got_symbol_offset, (const char *) NULL, FALSE, - bed->collect, (struct bfd_link_hash_entry **) &h))) + 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; -- 2.11.4.GIT