aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-07-12 09:02:00 +0000
committerNick Clifton <nickc@redhat.com>2006-07-12 09:02:00 +0000
commit01eaea5ad27ebd470a27ae2f3c9ffd50956d4caf (patch)
tree615f18d78f0c5a4369ba68af08e2e714dc7568d7 /gas
parent743a4945a6a302c986ee2f2b6d113e33b968a2f8 (diff)
downloadgdb-01eaea5ad27ebd470a27ae2f3c9ffd50956d4caf.zip
gdb-01eaea5ad27ebd470a27ae2f3c9ffd50956d4caf.tar.gz
gdb-01eaea5ad27ebd470a27ae2f3c9ffd50956d4caf.tar.bz2
* config/tc-sh.c (md_apply_fix): Do not allow the generic code in
fixup_segment() to repeat a range check on a value that have already been checked here. * gas/sh/basic.exp: Run "too_large" dump test. * gas/sh/too_large.s: New test file. Check that .byte directives do not generate a bogus overflow message. * gas/sh/too_large.s: New test control file.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-sh.c5
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/sh/basic.exp2
-rw-r--r--gas/testsuite/gas/sh/too_large.d9
-rw-r--r--gas/testsuite/gas/sh/too_large.s39
6 files changed, 68 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index e3c02c8..0b72f17 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-12 Nick Clifton <nickc@redhat.com>
+
+ * config/tc-sh.c (md_apply_fix): Do not allow the generic code in
+ fixup_segment() to repeat a range check on a value that have
+ already been checked here.
+
2006-07-07 James E Wilson <wilson@specifix.com>
* config/tc-mips.c (mips_cpu_info_table): Add sb1a.
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 0abbe92..9d651de 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -4080,6 +4080,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
}
if (max != 0 && (val < min || val > max))
as_bad_where (fixP->fx_file, fixP->fx_line, _("offset out of range"));
+ else if (max != 0)
+ /* Stop the generic code from trying to overlow check the value as well.
+ It may not have the correct value anyway, as we do not store val back
+ into *valP. */
+ fixP->fx_no_overflow = 1;
if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0)
fixP->fx_done = 1;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index a4cd0e9..fcec568 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-07-12 Nick Clifton <nickc@redhat.com>
+
+ * gas/sh/basic.exp: Run "too_large" dump test.
+ * gas/sh/too_large.s: New test file. Check that .byte directives
+ do not generate a bogus overflow message.
+ * gas/sh/too_large.s: New test control file.
+
2006-07-05 Julian Brown <julian@codesourcery.com>
* gas/arm/vfp-neon-syntax.d: Tweak expected fmsrr syntax.
diff --git a/gas/testsuite/gas/sh/basic.exp b/gas/testsuite/gas/sh/basic.exp
index 093048b..2f9424d 100644
--- a/gas/testsuite/gas/sh/basic.exp
+++ b/gas/testsuite/gas/sh/basic.exp
@@ -167,6 +167,8 @@ if [istarget sh*-*-*] then {
# Test --allow-reg-prefix.
run_dump_test "reg-prefix"
+
+ run_dump_test "too_large"
}
}
diff --git a/gas/testsuite/gas/sh/too_large.d b/gas/testsuite/gas/sh/too_large.d
new file mode 100644
index 0000000..597e745
--- /dev/null
+++ b/gas/testsuite/gas/sh/too_large.d
@@ -0,0 +1,9 @@
+#name: Check for bogus overflow errors in .byte directives
+#as: -big -relax -isa=sh4a
+#nm: -n
+
+[ ]*U \.L318
+[ ]*U \.L319
+[ ]*U \.L320
+[ ]*U \.L321
+0+00100 t \.L307
diff --git a/gas/testsuite/gas/sh/too_large.s b/gas/testsuite/gas/sh/too_large.s
new file mode 100644
index 0000000..b67b8f7
--- /dev/null
+++ b/gas/testsuite/gas/sh/too_large.s
@@ -0,0 +1,39 @@
+ .file "too_large.c"
+ .text
+ nop
+ .align 8
+.L307:
+ .byte .L302-.L307
+ .byte .L303-.L307
+ .byte .L304-.L307
+ .byte .L305-.L307
+.L304:
+ mov.l .L318,r1
+ jsr @r1
+ mov r8,r4
+ lds r0,fpul
+ fsts fpul,fr1
+ flds fr1,fpul
+ sts fpul,r0
+ mov r14,r15
+ lds.l @r15+,pr
+ mov.l @r15+,r14
+ mov.l @r15+,r8
+ rts
+ nop
+.L305:
+ mov.l .L319,r7
+ jsr @r7
+ mov r8,r4
+ lds r0,fpul
+ bra .L307
+ fsts fpul,fr1
+.L303:
+ mov.l .L320,r6
+ jsr @r6
+ mov r8,r4
+ lds r0,fpul
+ bra .L307
+ fsts fpul,fr1
+.L302:
+ mov.l .L321,r5