aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-10-11 08:59:24 +0000
committerAlan Modra <amodra@gmail.com>2002-10-11 08:59:24 +0000
commitfe213ce218807c778bf853d24865342262a1de10 (patch)
tree7f55ad422bf389cfb253cafe04925a30d1b39fc7 /ld
parent14a793b2f2d16ac51e6ac53e817a60a520a83200 (diff)
downloadgdb-fe213ce218807c778bf853d24865342262a1de10.zip
gdb-fe213ce218807c778bf853d24865342262a1de10.tar.gz
gdb-fe213ce218807c778bf853d24865342262a1de10.tar.bz2
* pe-dll.c (make_import_fixup_mark): Avoid type-punned pointer.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog2
-rw-r--r--ld/pe-dll.c19
2 files changed, 14 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d814a56..71542dc 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,7 @@
2002-10-11 Alan Modra <amodra@bigpond.net.au>
+ * pe-dll.c (make_import_fixup_mark): Avoid type-punned pointer.
+
* ldgram.y (memory_spec): Provide empty action.
(section <NAME>): Likewise.
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 367759a..61dc16c 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -1978,7 +1978,7 @@ make_import_fixup_mark (rel)
struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
bfd *abfd = bfd_asymbol_bfd (sym);
- struct coff_link_hash_entry *myh = NULL;
+ struct bfd_link_hash_entry *bh;
if (!fixup_name)
{
@@ -2000,15 +2000,20 @@ make_import_fixup_mark (rel)
sprintf (fixup_name, "__fu%d_%s", counter++, sym->name);
+ bh = NULL;
bfd_coff_link_add_one_symbol (&link_info, abfd, fixup_name, BSF_GLOBAL,
current_sec, /* sym->section, */
- rel->address, NULL, true, false,
- (struct bfd_link_hash_entry **) &myh);
+ rel->address, NULL, true, false, &bh);
+
+ if (0)
+ {
+ struct coff_link_hash_entry *myh;
+
+ myh = (struct coff_link_hash_entry *) bh;
+ printf ("type:%d\n", myh->type);
+ printf ("%s\n", myh->root.u.def.section->name);
+ }
-#if 0
- printf ("type:%d\n", myh->type);
- printf ("%s\n", myh->root.u.def.section->name);
-#endif
return fixup_name;
}