aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-m10300.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-11-04 10:45:54 +0000
committerAlan Modra <amodra@gmail.com>2003-11-04 10:45:54 +0000
commit140fae3fce0bbf08c28525467d85408dd355fe03 (patch)
tree7a69c80112b89a53035c3768e8c724fefec31bff /bfd/elf-m10300.c
parent0f867abe4ab1bf1b680a54d930736b5180ecb7ab (diff)
downloadgdb-140fae3fce0bbf08c28525467d85408dd355fe03.zip
gdb-140fae3fce0bbf08c28525467d85408dd355fe03.tar.gz
gdb-140fae3fce0bbf08c28525467d85408dd355fe03.tar.bz2
* elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix
"dereferencing type-punned pointer" warnings.
Diffstat (limited to 'bfd/elf-m10300.c')
-rw-r--r--bfd/elf-m10300.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 9500573..19ba0d2 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;