(elf_hppa_final_link_relocate) Fix handling of branches.

This commit is contained in:
Alan Modra 2000-05-31 09:00:00 +00:00
parent 96f6d4c4e0
commit 70d72e0eec
2 changed files with 19 additions and 3 deletions

View File

@ -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,

View File

@ -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;
}