This is the mail archive of the binutils@sources.redhat.com 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]

Merge a fix from branch to mainline


In playing around with various things, I managed to trigger the
segfault rth fixed some time ago for the branch.  The mainline has
different relaxing code, and previously didn't hit this problem.

gas/ChangeLog
	From 2.11 branch 2001-03-30  Richard Henderson  <rth@redhat.com>
	* config/tc-i386.c (md_convert_frag): Don't die on local symbols
	that have been finalized.

-- 
Alan Modra

Index: gas/config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.95
diff -u -p -r1.95 tc-i386.c
--- tc-i386.c	2001/05/16 01:08:21	1.95
+++ tc-i386.c	2001/05/24 23:11:44
@@ -4049,7 +4049,12 @@ md_convert_frag (abfd, sec, fragP)
   target_address = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset;
 #ifdef BFD_ASSEMBLER
   /* Not needed otherwise?  */
-  target_address += symbol_get_frag (fragP->fr_symbol)->fr_address;
+  {
+    /* Local symbols which have already been resolved have a NULL frag.  */
+    fragS *sym_frag = symbol_get_frag (fragP->fr_symbol);
+    if (sym_frag)
+      target_address += sym_frag->fr_address;
+  }
 #endif
 
   /* Address opcode resides at in file space.  */


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