aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sh.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-09-28 00:41:27 +0000
committerDaniel Jacobowitz <drow@false.org>2002-09-28 00:41:27 +0000
commit8ba4dac030f0e32ab1589cf58e1dff856084bee9 (patch)
treeb269deafc59dc21ce9b9351e01e0ca422b858cb2 /gas/config/tc-sh.c
parent613d38b830681277708706b18fec7b327a5d0216 (diff)
downloadbinutils-8ba4dac030f0e32ab1589cf58e1dff856084bee9.zip
binutils-8ba4dac030f0e32ab1589cf58e1dff856084bee9.tar.gz
binutils-8ba4dac030f0e32ab1589cf58e1dff856084bee9.tar.bz2
2002-09-27 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* config/tc-sh.c (sh_force_relocation): Return 0 for some PC relative relocations when not relaxing. * testsuite/gas/sh/pcrel2.s: New. * testsuite/gas/sh/pcrel2.d: New. * testsuite/gas/sh/basic.exp: Add pcrel2 test.
Diffstat (limited to 'gas/config/tc-sh.c')
-rw-r--r--gas/config/tc-sh.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index b74dc56..be5e857 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -3219,6 +3219,18 @@ int
sh_force_relocation (fix)
fixS *fix;
{
+ /* These relocations can't make it into a DSO, so no use forcing
+ them for global symbols. */
+ if (! sh_relax
+ && (fix->fx_r_type == BFD_RELOC_SH_PCDISP8BY2
+ || fix->fx_r_type == BFD_RELOC_SH_PCDISP12BY2
+ || fix->fx_r_type == BFD_RELOC_SH_PCRELIMM8BY2
+ || fix->fx_r_type == BFD_RELOC_SH_PCRELIMM8BY4
+ || fix->fx_r_type == BFD_RELOC_8_PCREL
+ || fix->fx_r_type == BFD_RELOC_SH_SWITCH16
+ || fix->fx_r_type == BFD_RELOC_SH_SWITCH32))
+ return 0;
+
if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
|| fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY
|| fix->fx_r_type == BFD_RELOC_SH_LOOP_START