This is the mail archive of the
mailing list for the binutils project.
Re: Special names tha ld needs to recognize for hppa64-hp-hpux11.X
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: law at redhat dot com
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 12 Feb 2002 16:19:29 -0500 (EST)
- Subject: Re: Special names tha ld needs to recognize for hppa64-hp-hpux11.X
> > Thus, The problem must be that we are doing the relocations for
> > R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_FPTR14DR incorrectly.
Here is a fix. My simple static link now runs correctly and I have confirmed
that do_exitcu is called correctly during exit.
> > It would appear that we are using the function address rather than the
> > address of the .opd entry.
> Most likely.
> > I think I see the problem. See line 1654 in elf-hppa.h. I think we
> > need to use the .opd address for the LTOFF relocations, not the DLT
> > offset.
> Odd. According to my reading of the the ABI, I believe that code is
> correct. The LTOFF_FPTR21L and LTOFF_FPTR14DR relocs should be referencing
> the DLT, not accessing the .opd directly.
You are correct. The patch fixes the value put in the DLT entry. We
were loading the function address into the DLT entry in all cases. We
are supposed to load fptr () for the LTOFF_FPTR relocations.
> My ABI is V1.43 Oct 6, 1997.
I looked quite recently and that's what I got.
J. David Anglin firstname.lastname@example.org
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2002-02-12 John David Anglin <email@example.com>
* elf-hppa.h (elf_hppa_final_link_relocate): Use address of .opd
entry as value for the DLT entry in R_PARISC_LTOFF_FPTR relocations.
--- elf-hppa.h.save Tue Feb 12 14:20:47 2002
+++ elf-hppa.h Tue Feb 12 15:19:24 2002
@@ -1646,11 +1646,7 @@
a local function which had its address taken. */
if (dyn_h->h == NULL)
- bfd_put_64 (hppa_info->dlt_sec->owner,
- hppa_info->dlt_sec->contents + dyn_h->dlt_offset);
- /* Now handle .opd creation if needed. */
+ /* Now do .opd creation if needed. */
if (r_type == R_PARISC_LTOFF_FPTR14R
|| r_type == R_PARISC_LTOFF_FPTR14DR
|| r_type == R_PARISC_LTOFF_FPTR14WR
@@ -1674,7 +1670,16 @@
bfd_put_64 (hppa_info->opd_sec->owner, value,
+ dyn_h->opd_offset + 24));
+ /* DLT value is the address of the .opd entry. */
+ value = (dyn_h->opd_offset
+ + hppa_info->opd_sec->output_offset
+ + hppa_info->opd_sec->output_section->vma);
+ bfd_put_64 (hppa_info->dlt_sec->owner,
+ hppa_info->dlt_sec->contents + dyn_h->dlt_offset);
/* We want the value of the DLT offset for this symbol, not