This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCHx2] Fix symbol handling bug in plugin API (+ testsuite noise fix reposted)



    Hi list,

  I found one little bug in the plugin API while lto-bootstrapping GCC, a dumb
thinko where I check the initial rather than current symbol type before
deciding which format of hash table entry to access.  Easily fixed by looking
in the right place instead of the wrong one!

ld/ChangeLog:

	* plugin.c (get_symbols): Check symbol type correctly.

  There's also this testsuite tweak outstanding, which I'm reposting in case
it got lost in the noise.

ld/testsuite/ChangeLog:

	* ld-plugin/plugin.exp: Mark tests UNSUPPORTED, not UNRESOLVED, if
	no suitable target compiler is available.

  Both built and tested i686-pc-cygwin.  Can I get a couple of OKs?

    cheers,
      DaveK
Index: ld/plugin.c
===================================================================
RCS file: /cvs/src/src/ld/plugin.c,v
retrieving revision 1.3
diff -p -u -r1.3 plugin.c
--- ld/plugin.c	15 Oct 2010 16:21:41 -0000	1.3
+++ ld/plugin.c	17 Oct 2010 15:02:27 -0000
@@ -417,7 +417,7 @@ get_symbols (const void *handle, int nsy
       if (syms[n].def == LDPK_UNDEF || syms[n].def == LDPK_WEAKUNDEF
 	  || syms[n].def == LDPK_COMMON)
 	{
-	  asection *owner_sec = (syms[n].def == LDPK_COMMON)
+	  asection *owner_sec = (blhe->type == bfd_link_hash_common)
 				? blhe->u.c.p->section
 				: blhe->u.def.section;
 	  if (owner_sec->owner == link_info.output_bfd)
Index: ld/testsuite/ld-plugin/plugin.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-plugin/plugin.exp,v
retrieving revision 1.2
diff -p -u -r1.2 plugin.exp
--- ld/testsuite/ld-plugin/plugin.exp	15 Oct 2010 16:07:06 -0000	1.2
+++ ld/testsuite/ld-plugin/plugin.exp	17 Oct 2010 16:26:27 -0000
@@ -26,9 +26,11 @@ if ![check_plugin_api_available] {
 
 # And a compiler to be available.
 set can_compile 1
+set failure_kind "unresolved"
 if { [which $CC] == 0 } {
   # Don't fail immediately, 
   set can_compile 0
+  set failure_kind "unsupported"
 }
 
 pass "plugin API enabled"
@@ -154,11 +156,11 @@ set plugin_extra_elf_tests [list \
 
 if { !$can_compile || $failed_compile } {
     foreach testitem $plugin_tests {
-	unresolved [lindex $testitem 0]
+	$failure_kind [lindex $testitem 0]
     }
     if { [is_elf_format] } {
 	foreach testitem $plugin_extra_elf_tests {
-	    unresolved [lindex $testitem 0]
+	    $failure_kind [lindex $testitem 0]
 	}
     }
     return

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]