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 | 2123ce14d33bf8dc0a3970bb25b1c1910529a865 (patch) | |
tree | 142d060275109751cb9965d35f9d89d2b7fde02d /bfd/elf-hppa.h | |
parent | 7e81af3691f8b847b521d383b3d02dbd4e87c4f0 (diff) | |
download | gdb-2123ce14d33bf8dc0a3970bb25b1c1910529a865.tar.gz |
* 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 97768b19ad5..53a50ab159b 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. */ |