+2012-07-24 Sandra Loosemore <sandra@codesourcery.com>
+ Jie Zhang <jzhang918@gmail.com>
+
+ * config/tc-arm.c (md_apply_fix): Use encoding A2 of ADR
+ if offset is negative.
+
2012-07-16 Michael Zolotukhin <michael.v.zolotukhin@intel.com>
* config/tc-i386.c: Add ADX, RDSEED and PRFCHW asm directives.
}
}
- newimm = encode_arm_immediate (value);
temp = md_chars_to_number (buf, INSN_SIZE);
- /* If the instruction will fail, see if we can fix things up by
- changing the opcode. */
- if (newimm == (unsigned int) FAIL
- && (newimm = negate_data_op (&temp, value)) == (unsigned int) FAIL)
+ /* If the offset is negative, we should use encoding A2 for ADR. */
+ if ((temp & 0xfff0000) == 0x28f0000 && value < 0)
+ newimm = negate_data_op (&temp, value);
+ else
+ {
+ newimm = encode_arm_immediate (value);
+
+ /* If the instruction will fail, see if we can fix things up by
+ changing the opcode. */
+ if (newimm == (unsigned int) FAIL)
+ newimm = negate_data_op (&temp, value);
+ }
+
+ if (newimm == (unsigned int) FAIL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
_("invalid constant (%lx) after fixup"),
+2012-07-24 Sandra Loosemore <sandra@codesourcery.com>
+ Jie Zhang <jzhang918@gmail.com>
+
+ * gas/arm/adr.d: New test.
+ * gas/arm/adr.s: New test.
+
2012-07-16 Michael Zolotukhin <michael.v.zolotukhin@intel.com>
* gas/i386/i386.exp: Run adx, rdseed and prefetchw tests.
--- /dev/null
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: ADR
+
+# Test the `ADR' pseudo-op
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+ <.*> 824ff203 subhi pc, pc, #805306368 ; 0x30000000