assemble: only be optimistic with NO_SEG if we're really in pass 1
authorH. Peter Anvin <hpa@zytor.com>
Tue, 24 Feb 2009 01:51:25 +0000 (17:51 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 24 Feb 2009 01:51:25 +0000 (17:51 -0800)
Only be optimistic about the reachability of a symbol with NO_SEG if
we are truly in pass 1, i.e. it could possibly be just a forward
reference.  After we have done a single pass, if it is still NO_SEG,
then it is an absolute symbol and need to be treated as such.

assemble.c

index 748e62f..6fcb748 100644 (file)
@@ -263,7 +263,7 @@ static bool jmp_match(int32_t segment, int64_t offset, int bits,
 
     isize = calcsize(segment, offset, bits, ins, code);
 
-    if (ins->oprs[0].segment == NO_SEG)
+    if (passn == 1 && ins->oprs[0].segment == NO_SEG)
         /* Be optimistic in pass 1 */
         return true;