Module Name:    src
Committed By:   matt
Date:           Fri Jan  1 06:12:55 UTC 2010

Modified Files:
        src/external/gpl3/binutils/dist/gas: write.c

Log Message:
Don't allow a symbol + offset in a merge section to translated to a
.section + offset reference if offset is negative.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/binutils/dist/gas/write.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/gas/write.c
diff -u src/external/gpl3/binutils/dist/gas/write.c:1.2 src/external/gpl3/binutils/dist/gas/write.c:1.3
--- src/external/gpl3/binutils/dist/gas/write.c:1.2	Sun Nov 15 10:25:16 2009
+++ src/external/gpl3/binutils/dist/gas/write.c	Fri Jan  1 06:12:55 2010
@@ -822,10 +822,11 @@
 	  }
 
 	/* Never adjust a reloc against local symbol in a merge section with
-	   a non-zero addend if the addend would place the relocation otside
-	   the section's limits.  */
+	   a non-negative addend or if the addend would place the relocation
+	   outside the section's limits.  */
 	if ((symsec->flags & SEC_MERGE) != 0
-	    && (S_GET_VALUE(sym) + fixp->fx_offset >= bfd_get_section_size(symsec)
+	    && (S_GET_VALUE(sym) + fixp->fx_offset < S_GET_VALUE(sym)
+		|| S_GET_VALUE(sym) + fixp->fx_offset >= bfd_get_section_size(symsec)
 	        || fixp->fx_subsy != NULL))
 	  continue;
 

Reply via email to