From: Richard Sandiford Date: Fri, 5 Sep 2003 07:18:27 +0000 (+0000) Subject: gas/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d50879074249f8af4961f2722b7bd189d017bc1e;p=binutils-gdb.git gas/ * config/tc-frv.c (md_pcrel_from_section): Heed TC_FORCE_RELOCATION. gas/testsuite/ * gas/frv/reloc1.[sd]: New test. * gas/frv/allinsn.exp: Run it. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index c1c79db44e4..e576c98b426 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2003-09-05 Richard Sandiford + + * config/tc-frv.c (md_pcrel_from_section): Heed TC_FORCE_RELOCATION. + 2003-09-04 Nick Clifton * config/tc-v850.c (set_machine): Accept v850e1 machine number. diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c index 2b8d3ea88d4..6c73cb81cf1 100644 --- a/gas/config/tc-frv.c +++ b/gas/config/tc-frv.c @@ -1164,16 +1164,11 @@ md_convert_frag (abfd, sec, fragP) long md_pcrel_from_section (fixP, sec) fixS * fixP; - segT sec; + segT sec ATTRIBUTE_UNUSED; { - if (fixP->fx_addsy != (symbolS *) NULL - && (! S_IS_DEFINED (fixP->fx_addsy) - || S_GET_SEGMENT (fixP->fx_addsy) != sec)) - { - /* The symbol is undefined (or is defined but not in this section). - Let the linker figure it out. */ - return 0; - } + /* Make no adjustment for relocations that will be written out. */ + if (TC_FORCE_RELOCATION (fixP)) + return 0; return (fixP->fx_frag->fr_address + fixP->fx_where) & ~1; } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 54324dd911e..b001c5c3cc7 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-09-05 Richard Sandiford + + * gas/frv/reloc1.[sd]: New test. + * gas/frv/allinsn.exp: Run it. + 2003-09-04 Nick Clifton * gas/v850/v850e1.s: New test source file. diff --git a/gas/testsuite/gas/frv/allinsn.exp b/gas/testsuite/gas/frv/allinsn.exp index 29a742f8bd6..30cdf671885 100644 --- a/gas/testsuite/gas/frv/allinsn.exp +++ b/gas/testsuite/gas/frv/allinsn.exp @@ -2,4 +2,5 @@ if [istarget frv*-*-*] { run_dump_test "allinsn" + run_dump_test "reloc1" } diff --git a/gas/testsuite/gas/frv/reloc1.d b/gas/testsuite/gas/frv/reloc1.d new file mode 100644 index 00000000000..9d7d88f0f47 --- /dev/null +++ b/gas/testsuite/gas/frv/reloc1.d @@ -0,0 +1,21 @@ +#objdump: -dr + +.* elf32-frv + +Disassembly.*: + +.* : +.*: 80 88 00 00 * nop +.*: 80 88 00 00 * nop +.* : +.*: 80 88 00 00 * nop +.*: 80 88 00 00 * nop +.*: 80 88 00 00 * nop +.* : +.*: 80 3c 00 00 * call.* + .*: R_FRV_LABEL24 f1 +.*: c0 1a 00 00 * bra.* + .*: R_FRV_LABEL16 f1 +.*: fe 3f ff fe * call .* +.*: c0 1a ff fd * bra .* + \.\.\. diff --git a/gas/testsuite/gas/frv/reloc1.s b/gas/testsuite/gas/frv/reloc1.s new file mode 100644 index 00000000000..5a5ee18f679 --- /dev/null +++ b/gas/testsuite/gas/frv/reloc1.s @@ -0,0 +1,14 @@ + .globl f1 +begin: + nop + nop +f1: + nop + nop + nop +f2: + call f1 + bra f1 + call f2 + bra f2 + .space 16