From 1afc8defa6693f44bfe41ac49d62c2d6b4e62f69 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Mon, 16 Jun 2008 15:04:41 +0000 Subject: PR gas/6607 * config/tc-mmix.c (s_loc): Assume "negative" addresses belong to text_section. Do the "stepping backwards" test for text_section using unsigned operands. --- gas/ChangeLog | 7 +++++++ gas/config/tc-mmix.c | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index cab22f4..160d5d0 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2008-06-16 Hans-Peter Nilsson + + PR gas/6607 + * config/tc-mmix.c (s_loc): Assume "negative" addresses belong to + text_section. Do the "stepping backwards" test for text_section + using unsigned operands. + 2008-06-13 Peter Bergner * config/tc-ppc.c (ppc_cpu): Use ppc_cpu_t typedef. diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c index 056298b..c2b3789 100644 --- a/gas/config/tc-mmix.c +++ b/gas/config/tc-mmix.c @@ -3891,7 +3891,9 @@ s_loc (int ignore ATTRIBUTE_UNUSED) if (exp.X_add_number < ((offsetT) 0x20 << 56)) { - /* Lower than Data_Segment - assume it's .text. */ + /* Lower than Data_Segment or in the reserved area (the + segment number is >= 0x80, appearing negative) - assume + it's .text. */ section = text_section; /* Save the lowest seen location, so we can pass on this @@ -3903,8 +3905,8 @@ s_loc (int ignore ATTRIBUTE_UNUSED) this one), we org at (this - lower). There's an implicit "LOC 0" before any entered code. FIXME: handled by spurious settings of text_has_contents. */ - if (exp.X_add_number < 0 - || exp.X_add_number < (offsetT) lowest_text_loc) + if (lowest_text_loc != (bfd_vma) -1 + && (bfd_vma) exp.X_add_number < lowest_text_loc) { as_bad (_("LOC expression stepping backwards is not supported")); exp.X_op = O_absent; @@ -3927,7 +3929,8 @@ s_loc (int ignore ATTRIBUTE_UNUSED) } else { - /* Do the same for the .data section. */ + /* Do the same for the .data section, except we don't have + to worry about exp.X_add_number carrying a sign. */ section = data_section; if (exp.X_add_number < (offsetT) lowest_data_loc) -- cgit v1.1