Module Name: src
Committed By: matt
Date: Wed Aug 26 12:33:54 UTC 2009
Modified Files:
src/gnu/dist/binutils/gas [matt-nb5-mips64]: write.c
Log Message:
Rework previous fix. Instead of always allowing references against merge
string sections, only allow references against a merge section if said
reference is contained with the merge section.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3.32.1 -r1.1.1.3.32.2 src/gnu/dist/binutils/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/gnu/dist/binutils/gas/write.c
diff -u src/gnu/dist/binutils/gas/write.c:1.1.1.3.32.1 src/gnu/dist/binutils/gas/write.c:1.1.1.3.32.2
--- src/gnu/dist/binutils/gas/write.c:1.1.1.3.32.1 Tue Aug 25 23:29:40 2009
+++ src/gnu/dist/binutils/gas/write.c Wed Aug 26 12:33:54 2009
@@ -847,11 +847,13 @@
continue;
}
- /* Never adjust a reloc against local symbol in a non-string merge
- section with non-zero addend. */
+ /* Never adjust a reloc against local symbol in a merge section with
+ a non-zero addend if the addend would place the relocation outside
+ the section's limits. */
if ((symsec->flags & SEC_MERGE) != 0
- && (symsec->flags & SEC_STRINGS) == 0
- && (fixp->fx_offset != 0 || fixp->fx_subsy != NULL))
+ && (S_GET_VALUE(sym) + fixp->fx_offset >= bfd_get_section_size(symsec)
+ || S_GET_VALUE(sym) + fixp->fx_offset < 0
+ || fixp->fx_subsy != NULL))
continue;
/* Never adjust a reloc against TLS local symbol. */