summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-04-28 15:33:57 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-04-28 15:33:57 +0000
commit83b54a818c6ee713aebe90af59ad2d14ba281cb6 (patch)
tree1fd277c1b52e0ef13e632018162831b3fc80f8fd
parentbb3b7c318d9e436d0b3f4a2242f297edf597ab2c (diff)
downloadbinutils-redhat-83b54a818c6ee713aebe90af59ad2d14ba281cb6.tar.gz
PR ld/12614
* emultempl/pe.em (_after_open): Correctly check whether symbol is in undef list.
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/emultempl/pe.em6
2 files changed, 10 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index c1218b5ac5..37dc6caf25 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-28 Daniel C. Klauer <daniel.c.klauer@web.de>
+
+ PR ld/12614
+ * emultempl/pe.em (_after_open): Correctly check whether symbol is
+ in undef list.
+
2011-04-27 Alan Modra <amodra@gmail.com>
Backport from mainline.
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 976b622f84..f9085f2fe7 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1588,8 +1588,10 @@ gld_${EMULATION_NAME}_after_open (void)
/* If the symbol in the stub section has no other
undefined references, exclude the stub section
from the final link. */
- if (blhe && (blhe->type == bfd_link_hash_defined)
- && (blhe->u.undef.next == NULL))
+ if (blhe != NULL
+ && blhe->type == bfd_link_hash_defined
+ && blhe->u.undef.next == NULL
+ && blhe != link_info.hash->undefs_tail)
stub_sec->flags |= SEC_EXCLUDE;
}
}