From 6a0b987115782d6150665b45c72b75079cf0ce85 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 10 Sep 1999 14:05:36 +0000 Subject: [PATCH] * elf-hppa.h (elf_hppa_final_link_relocate): Get the right value for the stub address in a call through a stub. Install the value for a local symbol directly into the DLT instead of generating a reloc. Correctly handle FPTR64 relocs. --- bfd/ChangeLog | 5 +++++ bfd/elf-hppa.h | 26 +++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 07b17b0..7e39172 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ Fri Sep 10 00:35:14 1999 Jeffrey A Law (law@cygnus.com) + * elf-hppa.h (elf_hppa_final_link_relocate): Get the right + value for the stub address in a call through a stub. + Install the value for a local symbol directly into the DLT + instead of generating a reloc. Correctly handle FPTR64 relocs. + * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): New function. (elf_hppa_remark_useless_dynamic_symbols): Similarly. (elf_hppa_final_link): Call them. diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index 97768b1..53a50ab 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1171,7 +1171,8 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, library, then redirect the call to the local stub for this function. */ if (sym_sec->output_section == NULL) - value = dyn_h->stub_offset; + value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + + hppa_info->stub_sec->output_section->vma); /* Turn VALUE into a proper PC relative address. */ value -= (offset + input_section->output_offset @@ -1213,6 +1214,20 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_LTOFF16WF: case R_PARISC_LTOFF16DF: { + /* If this relocation was against a local symbol, then we still + have not set up the DLT entry (it's not convienent to do so + in the "finalize_dlt" routine because it is difficult to get + to the local symbol's value). + + So, if this is a local symbol (h == NULL), then we need to + fill in its DLT entry. */ + if (dyn_h->h == NULL) + { + bfd_put_64 (hppa_info->dlt_sec->owner, + value, + hppa_info->dlt_sec->contents + dyn_h->dlt_offset); + } + /* We want the value of the DLT offset for this symbol, not the symbol's actual address. */ value = dyn_h->dlt_offset + hppa_info->dlt_sec->output_offset; @@ -1417,9 +1432,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, } - /* These do not require any work here. They are simply passed - through as dynamic relocations. */ case R_PARISC_FPTR64: + /* We want the value of the OPD offset for this symbol, not + the symbol's actual address. */ + value = (dyn_h->opd_offset + + hppa_info->opd_sec->output_offset + + hppa_info->opd_sec->output_section->vma); + + bfd_put_64 (input_bfd, value + addend, hit_data); return bfd_reloc_ok; /* Something we don't know how to handle. */ -- 2.7.4