From 8536ac1940c070d93b84d8d328f2a298d1aac76f Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 9 Sep 1999 14:10:24 +0000 Subject: [PATCH] * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and GPREL* relocations. (elf_hppa_relocate_insn): Similarly. --- bfd/ChangeLog | 4 ++++ bfd/elf-hppa.h | 35 ++++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 77a4f65745..c2de8513f8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,9 @@ Wed Sep 8 17:56:11 1999 Jeffrey A Law (law@cygnus.com) + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and + GPREL* relocations. + (elf_hppa_relocate_insn): Similarly. + * elf-hppa.h (elf_hppa_link_final_relocate): Fix typos. Handle LTOFF_TP* relocs. (elf_hppa_relocate_insn): Similarly. diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index d0c507a9d5..c8dab6c632 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1012,7 +1012,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, The list will be deleted eventually. 27210 R_PARISC_SEGREL32 - 791 R_PARISC_GPREL64 772 R_PARISC_PLTOFF14DR 386 R_PARISC_PLTOFF21L 6 R_PARISC_LTOFF64 @@ -1151,6 +1150,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_DLTREL14DR: case R_PARISC_DLTREL14WR: case R_PARISC_DLTREL21L: + case R_PARISC_DPREL21L: + case R_PARISC_DPREL14WR: + case R_PARISC_DPREL14DR: + case R_PARISC_DPREL14R: + case R_PARISC_DPREL14F: + case R_PARISC_GPREL16F: + case R_PARISC_GPREL16WF: + case R_PARISC_GPREL16DF: { /* Subtract out the global pointer value to make value a DLT relative address. */ @@ -1159,9 +1166,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, /* All DLTREL relocations are basically the same at this point, except that we need different field selectors for the 21bit version vs the 14bit versions. */ - if (r_type == R_PARISC_DLTREL21L) + if (r_type == R_PARISC_DLTREL21L + || r_type == R_PARISC_DPREL21L) value = hppa_field_adjust (value, addend, e_lrsel); - else if (r_type == R_PARISC_DLTREL14F) + else if (r_type == R_PARISC_DLTREL14F + || r_type == R_PARISC_DPREL14F + || r_type == R_PARISC_GPREL16F + || r_type == R_PARISC_GPREL16WF + || r_type == R_PARISC_GPREL16DF) value = hppa_field_adjust (value, addend, e_fsel); else value = hppa_field_adjust (value, addend, e_rrsel); @@ -1197,6 +1209,15 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, bfd_put_64 (input_bfd, value + addend, hit_data); return bfd_reloc_ok; + case R_PARISC_GPREL64: + /* Subtract out the global pointer value to make value a DLT + relative address. */ + value -= _bfd_get_gp_value (output_bfd); + value += addend; + + bfd_put_64 (input_bfd, value + addend, hit_data); + return bfd_reloc_ok; + case R_PARISC_PCREL32: { /* If this is a call to a function defined in another dynamic @@ -1326,6 +1347,7 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_LTOFF_FPTR21L: case R_PARISC_PCREL21L: case R_PARISC_LTOFF_TP21L: + case R_PARISC_DPREL21L: { int w; @@ -1352,6 +1374,9 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) 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: { int w; @@ -1374,6 +1399,8 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_PCREL16DF: case R_PARISC_LTOFF_TP14DR: case R_PARISC_LTOFF_TP16DF: + case R_PARISC_DPREL14DR: + case R_PARISC_GPREL16DF: { int w; @@ -1402,6 +1429,8 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_PCREL16WF: case R_PARISC_LTOFF_TP14WR: case R_PARISC_LTOFF_TP16WF: + case R_PARISC_DPREL14WR: + case R_PARISC_GPREL16WF: { int w; -- 2.11.0