Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!apple!portal!gouche!grant From: grant@gouche.UUCP (Grant Munsey) Newsgroups: comp.unix.sysv386 Subject: Building X386v1.1 Message-ID: <199@gouche.UUCP> Date: 20 Feb 91 01:16:22 GMT Organization: Manticore, Inc., Sunnyvale, CA Lines: 35 I found the following pitfall while rebuilding Thomas Roell's X386 v1.1 Environment: gcc 1.39 and ISC v2.2 After hacking include files some I got everything to compile and work without shared libs. When I tried to use shared libs I got the following ld error whenever I tried to link anything with the shared libs: ld fatal: cannot combine NOLOAD input sections with other input sections; possibly caused by shared library address space overlap After a few false starts I used 'dump -hv libX11_s.a' and found out that gcc1.39 (at least the version I ported) makes .bss sections for uninitialized global data. It seems that pcc on ISCv2.2 does not do this, allocating room in .data instead. Since Thomas did not have lines of the form: /**/#address .bss 0xB0800000 in his libxxx.def files (used for building shared libs) two section entries, one for .data and one for .bss, were being put into the shared lib. The .data and .bss sections had the same starting address! This was causing ld to barf as above. The fix I made is to go through all the *.def files in .../lib/* and reorder the .text/.data addresses, and add a .bss entry. As far as I could see, each of these segments must start on a 4mb boundary. This works but a simpler solution would be nice. Is there a flag in gcc 1.39 to force stuff into .data? Maybe something else I missed? -- Grant Munsey, Mainticore, Inc. (408) 733-3838 grant@gouche.portal.com or {uunet!opusys,decwrl!apple!portal}!gouche!grant