Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!uhccux!munnari.oz.au!metro!news From: obrian_n@maths.su.oz.au (Nigel O'Brian) Newsgroups: comp.sys.apollo Subject: Position Independent Code and Xt library Keywords: dynamic loading PIC libX11.a libXt.a Message-ID: <1990Nov20.011628.8963@metro.ucc.su.OZ.AU> Date: 20 Nov 90 01:16:28 GMT Sender: obrian_n@maths.su.oz.au (Nigel O'Brian) Reply-To: obrian_n@maths.su.oz.au (Nigel O'Brian) Organization: Dept of Pure Mathematics, University of Sydney Lines: 17 Nntp-Posting-Host: python.maths.su.oz.au I want to generate object modules containing Position Independent Code (PIC) for dynamic loading by the Domain loader. Usually this goes fine using cc -W0,-pic and ld -r -a -A noallres -A loadhigh. One can use /sys5.3/bin/dump -fv to check for the PIC flag on the output file. Problems start if one now wants to include a library in the link step. Quick check of the stuff in /usr/lib/X11 shows that libX11.a and libXt.a are not PIC. However, linking with libX11 still gives a PIC file, but linking with libXt gives a non-PIC file. In fact NONE of the constituent files in libXt are PIC. What's going on here? Can I link with libXt and still end up with a module which can be dynamically loaded or is this just impossible? How come libX11 doesn't cause this problem? This is SR10.2 on a DN2500.