All of lore.kernel.org
 help / color / mirror / Atom feed
* [parisc-linux] Incompatibility of PIC and non-PIC
@ 2000-08-17 22:25 David Huggins-Daines
  2000-08-18  0:12 ` Alan Modra
  0 siblings, 1 reply; 22+ messages in thread
From: David Huggins-Daines @ 2000-08-17 22:25 UTC (permalink / raw)
  To: Alan Modra; +Cc: parisc-linux

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.

^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <alan@linuxcare.com.au>]
* Re: Incompatibility of PIC and non-PIC
@ 2000-08-23 10:31 Tor Arntsen
  2000-08-23 10:46 ` Alan Modra
  0 siblings, 1 reply; 22+ messages in thread
From: Tor Arntsen @ 2000-08-23 10:31 UTC (permalink / raw)
  To: Alan Modra; +Cc: parisc-linux, parisc

On Aug 23, 10:49, Alan Modra wrote:
>On Wed, 23 Aug 2000, Tor Arntsen wrote:
>
>> Which versions of CVS are you using?  CVS used to output diffs without
>> including the directory path in the --- and +++ lines, but that's been
>> fixed long ago.  I don't have any problems with patch anymore.
>
>You will if the diff contains files that exist in the root dir of your
>source tree and in subdirs, eg. Makefile.in and bfd/Makefile.in

No, I do that all the time and has been doing that for almost two years
without problems.  It's true that it used to be a problem.  This is what
I'm working with at this moment:

cvs -q -n upd
M ChangeLog
M tools/ChangeLog
M tools/ts-initdir.c

cvs -q diff -u > dif

The diff looks like this:

Index: ChangeLog
===================================================================
RCS file: /cvs/cvs4/lrdpf/src/libs/lib_lrdpf_table/ChangeLog,v
retrieving revision 1.1.4.2.6.5
diff -u -r1.1.4.2.6.5 ChangeLog
--- ChangeLog   2000/04/01 16:54:01     1.1.4.2.6.5
+++ ChangeLog   2000/08/23 09:57:10
@@ -1,3 +1,73 @@
+Wed Aug 23 00:01:15 2000  tor@deneb.spacetec.no  (Tor Arntsen)
+
+       * TODO: Updated.
+
..
Index: tools/ChangeLog
===================================================================
RCS file: /cvs/cvs4/lrdpf/src/libs/lib_lrdpf_table/tools/Attic/ChangeLog,v
retrieving revision 1.1.2.1.6.2
diff -u -r1.1.2.1.6.2 ChangeLog
--- tools/ChangeLog     1999/05/25 10:54:39     1.1.2.1.6.2
+++ tools/ChangeLog     2000/08/23 09:57:10
@@ -1,3 +1,16 @@
+Wed Aug 23 00:33:48 2000  tor@deneb.spacetec.no  (Tor Arntsen)
+
+       * ts-initdir.c: Removed local copied functions get_table_dir() and
..

I now use that diff as input to patch somewhere else:
patch -p0 < dif
patching file ChangeLog
patching file tools/ChangeLog
patching file tools/ts-initdir.c

The patch is correctly applied.

The problem with older CVS versions was that it used to say just
--- ChangeLog on all the levels.  Patch could handle that, using
the Index line, however only for unique file names.  So people would
use scripts that fixed the ---/+++ lines before they applied the patch.

-Tor

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: Incompatibility of PIC and non-PIC
@ 2000-08-23 11:26 Tor Arntsen
  2000-08-23 13:51 ` Matthew Wilcox
  0 siblings, 1 reply; 22+ messages in thread
From: Tor Arntsen @ 2000-08-23 11:26 UTC (permalink / raw)
  To: Alan Modra; +Cc: parisc-linux, parisc

On Aug 23, 11:47, Alan Modra wrote:
>Ah Ha!  So an update of puffin cvs would be a good idea.  Provided said
>update didn't trash all the old repositories...

Recommended.  I'm using version 1.10.8.1 on both servers and clients
and before that I went through 1.10.6.1 and 1.10.[2-4], I believe the 
problem was fixed in one of the early 1.10.x versions.  No problems with 
the repositories, the upgrades were transparent for the users.  
Older 1.10 clients also work ok with the latest server versions, although 
I've never used the actual 1.10 -- it had its own problems that were fixed 
in 1.10.1 or .2 or so.  I'm not sure what the latest version is called but
I can recommend 1.10.8.1.  It has a few obscure bugs that most of us will
not run in to and it's as good as or better than any version before it.
And it makes good diffs :-)

-Tor
(I maintain the CVS repositories at the site where I work)

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2000-08-23 14:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-17 22:25 [parisc-linux] Incompatibility of PIC and non-PIC David Huggins-Daines
2000-08-18  0:12 ` 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
     [not found] <alan@linuxcare.com.au>
2000-08-23  8:49 ` Tor Arntsen
2000-08-23  9:49   ` Alan Modra
  -- strict thread matches above, loose matches on Subject: below --
2000-08-23 10:31 Tor Arntsen
2000-08-23 10:46 ` Alan Modra
2000-08-23 11:26 Tor Arntsen
2000-08-23 13:51 ` Matthew Wilcox

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.