From 8267b1550cbeeb920d610076d0ae93c8782750a8 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 9 Sep 1999 14:20:18 +0000 Subject: [PATCH] * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs. (elf_hppa_relocate_insn): Similarly. --- bfd/ChangeLog | 3 +++ bfd/elf-hppa.h | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c2de8513f80..eb05b495385 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ Wed Sep 8 17:56:11 1999 Jeffrey A Law (law@cygnus.com) + * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs. + (elf_hppa_relocate_insn): Similarly. + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and GPREL* relocations. (elf_hppa_relocate_insn): Similarly. diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index c8dab6c632f..765e4e729da 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1012,8 +1012,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, The list will be deleted eventually. 27210 R_PARISC_SEGREL32 - 772 R_PARISC_PLTOFF14DR - 386 R_PARISC_PLTOFF21L 6 R_PARISC_LTOFF64 5 R_PARISC_SEGREL64 */ @@ -1182,6 +1180,36 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, break; } + case R_PARISC_PLTOFF21L: + case R_PARISC_PLTOFF14R: + case R_PARISC_PLTOFF14F: + case R_PARISC_PLTOFF14WR: + case R_PARISC_PLTOFF14DR: + case R_PARISC_PLTOFF16F: + case R_PARISC_PLTOFF16WF: + case R_PARISC_PLTOFF16DF: + { + /* We want the value of the PLT offset for this symbol, not + the symbol's actual address. */ + value = dyn_h->plt_offset + hppa_info->plt_sec->output_offset; + + /* All PLTOFF 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_PLTOFF21L) + value = hppa_field_adjust (value, addend, e_lrsel); + else if (r_type == R_PARISC_PLTOFF14F + || r_type == R_PARISC_PLTOFF16F + || r_type == R_PARISC_PLTOFF16WF + || r_type == R_PARISC_PLTOFF16DF) + value = hppa_field_adjust (value, addend, e_fsel); + else + value = hppa_field_adjust (value, addend, e_rrsel); + + insn = elf_hppa_relocate_insn (insn, value, r_type); + break; + } + case R_PARISC_LTOFF_FPTR32: { /* We want the value of the DLT offset for this symbol, not @@ -1348,6 +1376,7 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_PCREL21L: case R_PARISC_LTOFF_TP21L: case R_PARISC_DPREL21L: + case R_PARISC_PLTOFF21L: { int w; @@ -1377,6 +1406,9 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DPREL14R: case R_PARISC_DPREL14F: case R_PARISC_GPREL16F: + case R_PARISC_PLTOFF14R: + case R_PARISC_PLTOFF14F: + case R_PARISC_PLTOFF16F: { int w; @@ -1401,6 +1433,8 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_LTOFF_TP16DF: case R_PARISC_DPREL14DR: case R_PARISC_GPREL16DF: + case R_PARISC_PLTOFF14DR: + case R_PARISC_PLTOFF16DF: { int w; @@ -1431,6 +1465,8 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_LTOFF_TP16WF: case R_PARISC_DPREL14WR: case R_PARISC_GPREL16WF: + case R_PARISC_PLTOFF14WR: + case R_PARISC_PLTOFF16WF: { int w; -- 2.30.2