summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2000-05-31 09:00:00 +0000
committerAlan Modra <amodra@bigpond.net.au>2000-05-31 09:00:00 +0000
commit7d9a1641cdc7ba2dae64af7d534ce90039d2c636 (patch)
treee93e9238b9061be3a4d98aabc2a4b3895bc055af
parent2e047f91cfbe7f0587bbba29cf21c924f78036c3 (diff)
downloadbinutils-redhat-7d9a1641cdc7ba2dae64af7d534ce90039d2c636.tar.gz
(elf_hppa_final_link_relocate) Fix handling of branches.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf-hppa.h16
2 files changed, 19 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 12fb552fad..20526a4c9d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2000-05-31 Alan Modra <alan@linuxcare.com.au>
+
+ * elf-hppa.h: (elf_hppa_final_link_relocate): Use e_rsel field
+ selector for R_PARISC_PCREL17R. R_PARISC_DIR17R and
+ R_PARISC_DIR17F are for absolute branches; Handle them as such.
+
2000-05-30 Nick Clifton <nickc@cygnus.com>
* cpu-i960.c (scan_960_mach): Accept 80960KA, 80960KB,
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index dab039b09a..0a4dc649e3 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -1521,7 +1521,10 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
+ input_section->output_section->vma);
/* Adjust for any field selectors. */
- value = hppa_field_adjust (value, -8 + addend, e_fsel);
+ if (r_type == R_PARISC_PCREL17R)
+ value = hppa_field_adjust (value, -8 + addend, e_rsel);
+ else
+ value = hppa_field_adjust (value, -8 + addend, e_fsel);
/* All branches are implicitly shifted by 2 places. */
value >>= 2;
@@ -1681,8 +1684,9 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
case R_PARISC_DIR16DF:
{
/* All DIR relocations are basically the same at this point,
- except that we need different field selectors for the 21bit
- version vs the 14bit versions. */
+ except that branch offsets need to be divided by four, and
+ we need different field selectors. Note that we don't
+ redirect absolute calls to local stubs. */
if (r_type == R_PARISC_DIR21L)
value = hppa_field_adjust (value, addend, e_lrsel);
@@ -1694,6 +1698,12 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
else
value = hppa_field_adjust (value, addend, e_rrsel);
+ if (r_type == R_PARISC_DIR17R || r_type == R_PARISC_DIR17F)
+ {
+ /* All branches are implicitly shifted by 2 places. */
+ value >>= 2;
+ }
+
insn = elf_hppa_relocate_insn (insn, value, r_type);
break;
}