summaryrefslogtreecommitdiff
path: root/bfd/ecoff.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2002-10-11 08:33:11 +0000
committerAlan Modra <amodra@bigpond.net.au>2002-10-11 08:33:11 +0000
commit2a14282fa1fdce81d949dd8ee86b54898073ec0a (patch)
tree507ec00957a8442f4809895bba63fc039c21f393 /bfd/ecoff.c
parent51d4a85da5d64b4603e8cd72a6a513ad5294738b (diff)
downloadbinutils-redhat-2a14282fa1fdce81d949dd8ee86b54898073ec0a.tar.gz
Fix numerous occurrences of
warning: dereferencing type-punned pointer will break strict-aliasing rules
Diffstat (limited to 'bfd/ecoff.c')
-rw-r--r--bfd/ecoff.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 47b6582234..4f129f602f 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -3837,7 +3837,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
= backend->debug_swap.swap_ext_in;
bfd_size_type external_ext_size = backend->debug_swap.external_ext_size;
unsigned long ext_count;
- struct ecoff_link_hash_entry **sym_hash;
+ struct bfd_link_hash_entry **sym_hash;
char *ext_ptr;
char *ext_end;
bfd_size_type amt;
@@ -3846,10 +3846,10 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
amt = ext_count;
amt *= sizeof (struct bfd_link_hash_entry *);
- sym_hash = (struct ecoff_link_hash_entry **) bfd_alloc (abfd, amt);
+ sym_hash = (struct bfd_link_hash_entry **) bfd_alloc (abfd, amt);
if (!sym_hash)
return false;
- ecoff_data (abfd)->sym_hashes = sym_hash;
+ ecoff_data (abfd)->sym_hashes = (struct ecoff_link_hash_entry **) sym_hash;
ext_ptr = (char *) external_ext;
ext_end = ext_ptr + ext_count * external_ext_size;
@@ -3980,15 +3980,13 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
name = ssext + esym.asym.iss;
- h = NULL;
if (! (_bfd_generic_link_add_one_symbol
(info, abfd, name,
(flagword) (esym.weakext ? BSF_WEAK : BSF_GLOBAL),
- section, value, (const char *) NULL, true, true,
- (struct bfd_link_hash_entry **) &h)))
+ section, value, (const char *) NULL, true, true, sym_hash)))
return false;
- *sym_hash = h;
+ h = (struct ecoff_link_hash_entry *) *sym_hash;
/* If we are building an ECOFF hash table, save the external
symbol information. */