diff options
author | Carlos O'Donell <carlos@codesourcery.com> | 2008-07-07 19:12:58 +0000 |
---|---|---|
committer | Carlos O'Donell <carlos@codesourcery.com> | 2008-07-07 19:12:58 +0000 |
commit | 79947c5421861704e56232699b629b1f13d400e3 (patch) | |
tree | abb4f7d5051a5f8ca7ee602348cb1af338fe2c97 /gas | |
parent | c27e721e3e80bd3557657ce6175e0dc52233b977 (diff) | |
download | gdb-79947c5421861704e56232699b629b1f13d400e3.zip gdb-79947c5421861704e56232699b629b1f13d400e3.tar.gz gdb-79947c5421861704e56232699b629b1f13d400e3.tar.bz2 |
gas/
2008-07-07 Paul Brook <paul@codesourcery.com>
* config/tc-arm.c (arm_fix_adjustable): Don't adjust MOVW/MOVT
relocations.
gas/testsuite/
2008-07-07 Paul Brook <paul@codesourcery.com>
* gas/arm/movw-local.d: New test.
* gas/arm/movw-local.s: New test.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-arm.c | 11 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/movw-local.d | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/movw-local.s | 13 |
5 files changed, 50 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 1268f2f..225b521 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2008-07-07 Paul Brook <paul@codesourcery.com> + + * config/tc-arm.c (arm_fix_adjustable): Don't adjust MOVW/MOVT + relocations. + 2008-07-07 Ralf Corsépius <ralf.corsepius@rtems.org> * configure.tgt: Add bfin-*-rtems*. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 8aba5fc..0c05074 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -19420,6 +19420,17 @@ arm_fix_adjustable (fixS * fixP) || fixP->fx_r_type == BFD_RELOC_ARM_LDR_PC_G0) return 0; + /* MOVW/MOVT REL relocations have limited offsets, so keep the symbols. */ + if (fixP->fx_r_type == BFD_RELOC_ARM_MOVW + || fixP->fx_r_type == BFD_RELOC_ARM_MOVT + || fixP->fx_r_type == BFD_RELOC_ARM_MOVW_PCREL + || fixP->fx_r_type == BFD_RELOC_ARM_MOVT_PCREL + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVW + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVW_PCREL + || fixP->fx_r_type == BFD_RELOC_ARM_THUMB_MOVT_PCREL) + return 0; + return 1; } #endif /* defined (OBJ_ELF) || defined (OBJ_COFF) */ diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 8366360..aca2c7e 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-07 Paul Brook <paul@codesourcery.com> + + * gas/arm/movw-local.d: New test. + * gas/arm/movw-local.s: New test. + 2008-06-27 Chao-ying Fu <fu@mips.com> * gas/mips/odd-float.d: Replace ... with #pass. diff --git a/gas/testsuite/gas/arm/movw-local.d b/gas/testsuite/gas/arm/movw-local.d new file mode 100644 index 0000000..5fc7727 --- /dev/null +++ b/gas/testsuite/gas/arm/movw-local.d @@ -0,0 +1,16 @@ +#objdump: -dr --prefix-addresses --show-raw-insn +#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix* +#name: MOVW/MOVT relocations against local symbols + +.*: +file format .*arm.* + +Disassembly of section .text: +0[0-9a-f]+ <[^>]+> e3000000 movw r0, #0 ; 0x0 + 0: R_ARM_MOVW_ABS_NC bar +0[0-9a-f]+ <[^>]+> e3400000 movt r0, #0 ; 0x0 + 4: R_ARM_MOVT_ABS bar +0[0-9a-f]+ <[^>]+> f240 0000 movw r0, #0 ; 0x0 + 8: R_ARM_THM_MOVW_ABS_NC bar +0[0-9a-f]+ <[^>]+> f2c0 0000 movt r0, #0 ; 0x0 + c: R_ARM_THM_MOVT_ABS bar +#... diff --git a/gas/testsuite/gas/arm/movw-local.s b/gas/testsuite/gas/arm/movw-local.s new file mode 100644 index 0000000..fa923c9 --- /dev/null +++ b/gas/testsuite/gas/arm/movw-local.s @@ -0,0 +1,13 @@ +.arch armv7-a +.text +.syntax unified +foo: +movw r0, #:lower16: bar +movt r0, #:upper16: bar +.thumb +movw r0, #:lower16: bar +movt r0, #:upper16: bar + +.space 0x10000 + +bar: |