All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Huggins-Daines <dhd@linuxcare.com>
To: Cary Coutant <cary@cup.hp.com>
Cc: <parisc-linux@thepuffingroup.com>
Subject: Re: [parisc-linux] PIC code generation in gcc/binutils
Date: 24 Jul 2000 20:23:24 -0400	[thread overview]
Message-ID: <87zon7qcqr.fsf@linuxcare.com> (raw)
In-Reply-To: 200007250000.RAA03038@adlmail.cup.hp.com

Cary Coutant <cary@cup.hp.com> writes:

> The model used for PA-RISC is a a consequence of the segmented 
> architecture, where the text and data segments are not adjacent.

For what it's worth our ELF32 runtime conventions do not use
segmentation at all.  That is, in user space, %sr0 and %sr4 through
%sr7 are all set to the same space identifier.

This is in keeping with accepted practice on other 32-bit Linux
platforms where segmentation is used only to provide separate 4G
address spaces for the kernel and userland.

> As a result, a procedure cannot materialize its own gp, since there
> is no fixed pc-relative offset between the text and data. This means
> that the caller must materialize the gp prior to the call, or as
> part of the call.

I can see some advantages in this even with a non-segmented runtime
architecture - theoretically, having the GP be managed by the caller
rather than the callee should make intramodule calls in
position-independent code more efficient.  (I think so at least)

One thing I have not figured out is how the GP is "bootstrapped" in
the startup code for the dynamic linker itself - how does ELF64 on
HP/UX deal with this problem?

> By the way, this model is also being used for IA-64. You may be able to 
> leverage some of the work being done for ld.so on that platform.

Thanks for the tip... as it turns out, the author of the dynamic
linker support for GNU libc on IA-64 sits two cubes away from me, so
that should be quite helpful indeed :-)

> Lazy binding requires a bit of cleverness. We do it by dynamically 
> creating lazy-binding stubs that load a module id and a PLT index into 
> registers, then branch to a common bind-on-reference routine.

For the moment I am not going to worry about lazy binding at all,
though it is certainly a requirement in the future.

-- 
dhd@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.

  parent reply	other threads:[~2000-07-25  0:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-24 23:58 [parisc-linux] PIC code generation in gcc/binutils Cary Coutant
2000-07-25  0:05 ` Ulrich Drepper
2000-07-25  0:23 ` David Huggins-Daines [this message]
2000-07-25  1:12   ` Alan Modra
2000-07-25 14:36     ` Matthew Wilcox
2000-07-25 15:16     ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2000-07-25 17:21 Cary Coutant
2000-07-25 17:20 Cary Coutant
2000-07-18 17:58 David Huggins-Daines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zon7qcqr.fsf@linuxcare.com \
    --to=dhd@linuxcare.com \
    --cc=cary@cup.hp.com \
    --cc=parisc-linux@thepuffingroup.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.