From 021c2b5e4ba370c7818c09d1b85a105939fc6377 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 19 Sep 2002 16:13:38 +0000 Subject: [PATCH] * config/tc-alpha.c (md_pcrel_from): Only adjust special for branch type relocs. (alpha_force_relocation): Don't special-case branch type relocs. * gas/alpha/elf-reloc-7.s: New. * gas/alpha/elf-reloc-7.d: New. * gas/alpha/alpha.exp: Run it. --- gas/ChangeLog | 6 ++++++ gas/config/tc-alpha.c | 14 +++++--------- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/alpha/alpha.exp | 1 + gas/testsuite/gas/alpha/elf-reloc-7.d | 22 ++++++++++++++++++++++ gas/testsuite/gas/alpha/elf-reloc-7.s | 26 ++++++++++++++++++++++++++ 6 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 gas/testsuite/gas/alpha/elf-reloc-7.d create mode 100644 gas/testsuite/gas/alpha/elf-reloc-7.s diff --git a/gas/ChangeLog b/gas/ChangeLog index c9a9cd7894e..a4cc1f1574b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2002-09-19 Richard Henderson + + * config/tc-alpha.c (md_pcrel_from): Only adjust special for + branch type relocs. + (alpha_force_relocation): Don't special-case branch type relocs. + 2002-09-19 Nick Clifton * config/tc-m68k.c (select_control_regs): Handle situation where diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index 7b65354aef6..0dc875b2cf5 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -1139,12 +1139,12 @@ md_pcrel_from (fixP) valueT addr = fixP->fx_where + fixP->fx_frag->fr_address; switch (fixP->fx_r_type) { - case BFD_RELOC_ALPHA_GPDISP: - case BFD_RELOC_ALPHA_GPDISP_HI16: - case BFD_RELOC_ALPHA_GPDISP_LO16: - return addr; + case BFD_RELOC_23_PCREL_S2: + case BFD_RELOC_ALPHA_HINT: + case BFD_RELOC_ALPHA_BRSGP: + return addr + 4; default: - return fixP->fx_size + addr; + return addr; } } @@ -1501,10 +1501,6 @@ alpha_force_relocation (f) case BFD_RELOC_ALPHA_TPREL16: return 1; - case BFD_RELOC_23_PCREL_S2: - case BFD_RELOC_ALPHA_HINT: - return 0; - default: break; } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 6ba656705cd..a9490153cb3 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2002-09-19 Richard Henderson + + * gas/alpha/elf-reloc-7.s: New. + * gas/alpha/elf-reloc-7.d: New. + * gas/alpha/alpha.exp: Run it. + 2002-09-18 Chris Demetriou * gas/mips/mips-abi32-pic2.s: New file. diff --git a/gas/testsuite/gas/alpha/alpha.exp b/gas/testsuite/gas/alpha/alpha.exp index 6564cf9e4f4..f0ac5158636 100644 --- a/gas/testsuite/gas/alpha/alpha.exp +++ b/gas/testsuite/gas/alpha/alpha.exp @@ -29,6 +29,7 @@ if { [istarget alpha*-*-*] } then { run_dump_test "elf-reloc-4" run_dump_test "elf-reloc-5" run_list_test "elf-reloc-6" "" + run_dump_test "elf-reloc-7" run_dump_test "elf-tls-1" run_list_test "elf-tls-2" "" run_list_test "elf-tls-3" "" diff --git a/gas/testsuite/gas/alpha/elf-reloc-7.d b/gas/testsuite/gas/alpha/elf-reloc-7.d new file mode 100644 index 00000000000..9ff7ff13e36 --- /dev/null +++ b/gas/testsuite/gas/alpha/elf-reloc-7.d @@ -0,0 +1,22 @@ +#objdump: -r +#name: alpha elf-reloc-7 + +.*: file format elf64-alpha + +RELOCATION RECORDS FOR \[\.text\]: +OFFSET TYPE VALUE +0*0000008 BRADDR bar + + +RELOCATION RECORDS FOR \[\.data\]: +OFFSET TYPE VALUE +0*0000004 SREL32 \.data2\+0x0*0000004 +0*0000008 SREL32 BAR + + +RELOCATION RECORDS FOR \[\.text2\]: +OFFSET TYPE VALUE +0*0000004 BRADDR \.text\+0x0*0000010 +0*0000008 BRADDR bar + + diff --git a/gas/testsuite/gas/alpha/elf-reloc-7.s b/gas/testsuite/gas/alpha/elf-reloc-7.s new file mode 100644 index 00000000000..d6409ea18a0 --- /dev/null +++ b/gas/testsuite/gas/alpha/elf-reloc-7.s @@ -0,0 +1,26 @@ + .section .data2,"wa" + .globl BAR + .long 0 +FOO: .long 0 +BAR: .long 0 + .long FOO - . + .long BAR - . + + .data + .long 0 + .long FOO - . + .long BAR - . + + .text + .globl bar + nop + br foo + br bar + nop +foo: nop +bar: nop + + .section .text2,"ax" + nop + br foo + br bar -- 2.30.2