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]

ld -shared -pie vs. unresolved symbols


There is a problem with the ia64 linker that it crashes when seeing a
R_IA64_PCREL21B relocation against an unresolved symbol, because no PLT
has been allocated for it.  This can be fixed with the patch below, but
I'm not sure whether that combination should be allowed in the first
place.

Andreas.

2007-07-03  Andreas Schwab  <schwab@suse.de>

	* elfxx-ia64.c (elfNN_ia64_relocate_section): Don't crash when
	references to unresolved symbols are ignored.

--- bfd/elfxx-ia64.c.~1.199.~	2007-06-19 17:10:30.000000000 +0200
+++ bfd/elfxx-ia64.c	2007-07-03 15:11:56.000000000 +0200
@@ -5045,8 +5045,10 @@ elfNN_ia64_relocate_section (output_bfd,
 	  else
 	    {
 	      /* Since there's no PLT entry, Validate that this is
-		 locally defined.  */
-	      BFD_ASSERT (undef_weak_ref || sym_sec->output_section != NULL);
+		 locally defined.  SYM_SEC can be NULL when references
+		 to unresolved symbols are ignored.  */
+	      BFD_ASSERT (undef_weak_ref || sym_sec == NULL
+			  || sym_sec->output_section != NULL);
 
 	      /* If the symbol is undef_weak, we shouldn't be trying
 		 to call it.  There's every chance that we'd wind up

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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