aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-07-16 02:26:30 +0000
committerAlan Modra <amodra@gmail.com>2002-07-16 02:26:30 +0000
commitba94744e3bc65b34908de8b953ade1e7f5ed002f (patch)
tree1ffa00955624095827d0d9c1495166210785e8bd
parentbe006b8b64ba2c7db3542bf7f08d62ea1e37ce9c (diff)
downloadgdb-ba94744e3bc65b34908de8b953ade1e7f5ed002f.zip
gdb-ba94744e3bc65b34908de8b953ade1e7f5ed002f.tar.gz
gdb-ba94744e3bc65b34908de8b953ade1e7f5ed002f.tar.bz2
* elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
the final type for the e_fsel selector when generating PA2.0W code. (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1 relocations.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf-hppa.h23
2 files changed, 21 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 27ff268..f094220 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-16 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as
+ the final type for the e_fsel selector when generating PA2.0W code.
+ (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1
+ relocations.
+
2002-07-14 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_assign_sym_version): Hide the default
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index d5a3d15..d58c5b1 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -811,7 +811,10 @@ elf_hppa_reloc_final_type (abfd, base_type, format, field)
final_type = R_PARISC_PCREL14R;
break;
case e_fsel:
- final_type = R_PARISC_PCREL14F;
+ if (bfd_get_mach (abfd) < 25)
+ final_type = R_PARISC_PCREL14F;
+ else
+ final_type = R_PARISC_PCREL16F;
break;
default:
return R_PARISC_NONE;
@@ -1609,8 +1612,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
case R_PARISC_NONE:
break;
- /* Basic function call support. I'm not entirely sure if PCREL14F is
- actually needed or even handled correctly.
+ /* Basic function call support.
Note for a call to a function defined in another dynamic library
we want to redirect the call to a stub. */
@@ -2182,24 +2184,27 @@ elf_hppa_relocate_insn (insn, sym_value, r_type)
case R_PARISC_DLTIND14R:
case R_PARISC_DLTIND14F:
case R_PARISC_LTOFF_FPTR14R:
- case R_PARISC_LTOFF_FPTR16F:
case R_PARISC_PCREL14R:
case R_PARISC_PCREL14F:
- case R_PARISC_PCREL16F:
case R_PARISC_LTOFF_TP14R:
case R_PARISC_LTOFF_TP14F:
- case R_PARISC_LTOFF_TP16F:
case R_PARISC_DPREL14R:
case R_PARISC_DPREL14F:
- case R_PARISC_GPREL16F:
case R_PARISC_PLTOFF14R:
case R_PARISC_PLTOFF14F:
- case R_PARISC_PLTOFF16F:
case R_PARISC_DIR14R:
case R_PARISC_DIR14F:
+ return (insn & ~0x3fff) | low_sign_unext (sym_value, 14);
+
+ /* PA2.0W LDO and integer loads/stores with 16 bit displacements. */
+ case R_PARISC_LTOFF_FPTR16F:
+ case R_PARISC_PCREL16F:
+ case R_PARISC_LTOFF_TP16F:
+ case R_PARISC_GPREL16F:
+ case R_PARISC_PLTOFF16F:
case R_PARISC_DIR16F:
case R_PARISC_LTOFF16F:
- return (insn & ~0x3fff) | low_sign_unext (sym_value, 14);
+ return (insn & ~0xffff) | re_assemble_16 (sym_value);
/* Doubleword loads and stores with a 14 bit displacement. */
case R_PARISC_DLTREL14DR: