Fixed bug in assembler: incorrect offset in LUI instruction.

This commit is contained in:
Serge Vakulenko
2014-04-24 11:56:01 -07:00
parent 8d5a6f60b1
commit 1b15bcff49

View File

@@ -1592,13 +1592,15 @@ foff16: expr_flags = 0;
opcode |= offset & 0xffff;
break;
case FHIGH16: /* high 16-bit byte address */
if (relinfo.flags != RABS) {
if (expr_flags & EXPR_HI) {
/* %hi function - assume signed offset */
relinfo.flags |= (expr_flags & EXPR_HI) ? RHIGH16S : RHIGH16;
relinfo.flags |= RHIGH16S;
relinfo.offset = offset & 0xffff;
offset += 0x8000;
opcode |= offset >> 16;
} else {
opcode |= offset & 0xffff;
}
opcode |= offset >> 16;
break;
case FOFF18: /* 18-bit PC-relative word address */
case FAOFF18: