All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Huggins-Daines <dhd@linuxcare.com>
To: Alan Modra <alan@linuxcare.com.au>
Cc: parisc-linux@thepuffingroup.com
Subject: [parisc-linux] Incompatibility of PIC and non-PIC
Date: 17 Aug 2000 18:25:37 -0400	[thread overview]
Message-ID: <87ya1v1q5a.fsf@linuxcare.com> (raw)

Hi,

Shared libraries work well, but we've got a bigger problem now.  Our
PIC and non-PIC code models are mutually incompatible in a big way
(due to the use of %r19 And, it seems, while it's fine if non-PIC
can't be used in shared libraries, it's not all right if PIC can't be
linked statically.

The reason this comes up is that libgcc.a has to be built with -fPIC
since it gets linked into libc.so.  However libgcc.a is also getting
statically linked with the binary itself (the symbols are not exported
by libc.so, though I'm not sure if this is the correct behaviour or
not), and of course it has to get linked in for statically linked
things anyway.

The result is of course that anything which uses 'long long', like,
say, GCC, will crash.

How do other architectures solve this issue? (or do they just have
ABIs that let you mix PIC and non-PIC...)

For that matter how does 32-bit HP/UX solve this issue?

One potential solution is to use %dp as the data pointer across the
board (which would solve the problem of mixing PIC and non-PIC in
static binaries), and generate export stubs for shared library calls
which restore the old %dp value (which would solve the problem of
maintaining the non-PIC %dp, useless though it may be).

<thinking wishful="wishful">
  Another one is to ditch our ... ahem ... unique ABI, use function
  prologues instead, have a single global pointer and a single link
  register, and have PIC, function pointers and dynamic linking work
  the way $DEITY intended :-)
</thinking>

Of course that's a lot more work and would probably involve breaking
the published ELF standard for HPPA, such as it is, as well as
foregoing a lot of code sharing with the rest of the PA-RISC stuff in
gcc and binutils :-(

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

             reply	other threads:[~2000-08-17 22:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-17 22:25 David Huggins-Daines [this message]
2000-08-18  0:12 ` Incompatibility of PIC and non-PIC Alan Modra
2000-08-18 14:29   ` Alan Modra
2000-08-18 17:25     ` David Huggins-Daines
2000-08-18 20:14       ` David Huggins-Daines
2000-08-18 23:35         ` Alan Modra
2000-08-19  5:29         ` Alan Modra
2000-08-21 17:46           ` David Huggins-Daines
2000-08-21 19:09             ` David Huggins-Daines
2000-08-21 23:39               ` Alan Modra
2000-08-19 22:00         ` David Huggins-Daines
2000-08-20  3:07           ` Alan Modra
2000-08-20  2:43             ` Matthew Wilcox
2000-08-20  4:19               ` Alan Modra
2000-08-21 13:41                 ` David Huggins-Daines
2000-08-21 13:38             ` David Huggins-Daines
  -- strict thread matches above, loose matches on Subject: below --
2000-09-12 20:39 [parisc-linux] " Cary Coutant
2000-09-13  0:30 ` Alan Modra
2000-09-13  3:17   ` 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=87ya1v1q5a.fsf@linuxcare.com \
    --to=dhd@linuxcare.com \
    --cc=alan@linuxcare.com.au \
    --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.