diff options
author | Paul Brook <paul@codesourcery.com> | 2011-05-31 14:10:07 +0000 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2011-05-31 14:10:07 +0000 |
commit | b58843019a8b7cb79ea5335498bb06c1d59d5d03 (patch) | |
tree | 8c0423bee413248a4e75c1cbd3485a2178f46f5e /gas/config/tc-arm.c | |
parent | 63e1a0fcbacd4cee2d74a2f31c84bce7807e5e77 (diff) | |
download | gdb-b58843019a8b7cb79ea5335498bb06c1d59d5d03.zip gdb-b58843019a8b7cb79ea5335498bb06c1d59d5d03.tar.gz gdb-b58843019a8b7cb79ea5335498bb06c1d59d5d03.tar.bz2 |
2011-05-31 Paul Brook <paul@codesourcery.com>
gas/
* config/tc-arm.c (arm_force_relocation): Resolve all pc-relative
loads.
gas/testsuite/
* gas/arm/ldr-global.d: New test.
* gas/arm/ldr-global.s: New test.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r-- | gas/config/tc-arm.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 964384c..6611e02 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -21895,14 +21895,25 @@ arm_force_relocation (struct fix * fixp) } #endif - /* Resolve these relocations even if the symbol is extern or weak. */ + /* Resolve these relocations even if the symbol is extern or weak. + Technically this is probably wrong due to symbol preemption. + In practice these relocations do not have enough range to be useful + at dynamic link time, and some code (e.g. in the Linux kernel) + expects these references to be resolved. */ if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE || fixp->fx_r_type == BFD_RELOC_ARM_OFFSET_IMM + || fixp->fx_r_type == BFD_RELOC_ARM_OFFSET_IMM8 || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE + || fixp->fx_r_type == BFD_RELOC_ARM_CP_OFF_IMM + || fixp->fx_r_type == BFD_RELOC_ARM_CP_OFF_IMM_S2 + || fixp->fx_r_type == BFD_RELOC_ARM_THUMB_OFFSET || fixp->fx_r_type == BFD_RELOC_ARM_T32_ADD_IMM || fixp->fx_r_type == BFD_RELOC_ARM_T32_IMMEDIATE || fixp->fx_r_type == BFD_RELOC_ARM_T32_IMM12 - || fixp->fx_r_type == BFD_RELOC_ARM_T32_ADD_PC12) + || fixp->fx_r_type == BFD_RELOC_ARM_T32_OFFSET_IMM + || fixp->fx_r_type == BFD_RELOC_ARM_T32_ADD_PC12 + || fixp->fx_r_type == BFD_RELOC_ARM_T32_CP_OFF_IMM + || fixp->fx_r_type == BFD_RELOC_ARM_T32_CP_OFF_IMM_S2) return 0; /* Always leave these relocations for the linker. */ |