summaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-10-11 00:25:32 +0000
committerAlan Modra <amodra@gmail.com>2002-10-11 00:25:32 +0000
commit3e02c1cc5888d91642282c58cb4bfb84bec1d70c (patch)
tree8aa7afe00554c4218533757e634598870b3a8bbf /gas/config
parent5b33f915bfb43c6fe229cfcdeaed10d371a67f36 (diff)
downloadbinutils-gdb-3e02c1cc5888d91642282c58cb4bfb84bec1d70c.tar.gz
* config/tc-i386.c (output_jump): Set fx_signed for loop/jcxz.
(md_estimate_size_before_relax): Likewise for 8 bit branches.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index b91b2bb9965..c7af77c7781 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3000,6 +3000,7 @@ output_jump ()
{
char *p;
int size;
+ fixS *fixP;
if (i.tm.opcode_modifier & JumpByte)
{
@@ -3050,8 +3051,14 @@ output_jump ()
p = frag_more (1 + size);
*p++ = i.tm.base_opcode;
- fix_new_exp (frag_now, p - frag_now->fr_literal, size,
- i.op[0].disps, 1, reloc (size, 1, 1, i.reloc[0]));
+ fixP = fix_new_exp (frag_now, p - frag_now->fr_literal, size,
+ i.op[0].disps, 1, reloc (size, 1, 1, i.reloc[0]));
+
+ /* All jumps handled here are signed, but don't use a signed limit
+ check for 32 and 16 bit jumps as we want to allow wrap around at
+ 4G and 64k respectively. */
+ if (size == 1)
+ fixP->fx_signed = 1;
}
static void
@@ -4394,11 +4401,14 @@ md_estimate_size_before_relax (fragP, segment)
case COND_JUMP:
if (no_cond_jump_promotion && fragP->fr_var == NO_RELOC)
{
+ fixS *fixP;
+
fragP->fr_fix += 1;
- fix_new (fragP, old_fr_fix, 1,
- fragP->fr_symbol,
- fragP->fr_offset, 1,
- BFD_RELOC_8_PCREL);
+ fixP = fix_new (fragP, old_fr_fix, 1,
+ fragP->fr_symbol,
+ fragP->fr_offset, 1,
+ BFD_RELOC_8_PCREL);
+ fixP->fx_signed = 1;
break;
}