diff options
author | Jeff Law <law@redhat.com> | 1999-09-10 14:05:36 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1999-09-10 14:05:36 +0000 |
commit | 6a0b987115782d6150665b45c72b75079cf0ce85 (patch) | |
tree | 47eff1ea768d3c0d0a8678905354890a89ed94a7 /bfd/elf-hppa.h | |
parent | af7dc6449e5accb8f11db2a29d864ab0c84f6f27 (diff) | |
download | gdb-6a0b987115782d6150665b45c72b75079cf0ce85.zip gdb-6a0b987115782d6150665b45c72b75079cf0ce85.tar.gz gdb-6a0b987115782d6150665b45c72b75079cf0ce85.tar.bz2 |
* 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.
Diffstat (limited to 'bfd/elf-hppa.h')
-rw-r--r-- | bfd/elf-hppa.h | 26 |
1 files changed, 23 insertions, 3 deletions
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. */ |