🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52406

HELP: gcc2.2.2, SVR3 shared libs and static data

#52406
From: Thomas Wolfram
Date: Fri, 25 Sep 1992 17:03
32 lines
2225 bytes
Hi, I'm about to create shared X11R5 (X386 1.2E/XFree86) libraries
for SVR3 (ISC 3.0) and I ran into following problem:

Gcc 2.2.2 puts uninitialized static data to the .bss section. Gcc 1.40
and AT&T cc did put it to .data. The problem is that it seems that a SVR3
target shared library not allows to have a section with the BSS attribute.
- I call it "section with the BSS attribute" since after running the
mkshlib tool the host shared library contains no longer a .bss section
but a .fkxxxx section on a fixed address marked with the BSS attribute
(where xxxx are the highest four digits of the (hexa) section address).
And this works only if I fake mkshlib a little, but this is another story. -
However, if I run a program linked with a shared library referencing data
in an BSS section I get a core dump. If I examine it I get always the same
result: the core is dumped when the program tryes to access somewhat in this
section. I assume this section isn't allocated.

I want to stick with gcc 2.2.2 and not go back to 1.40. But I don't
want to init all unitilialized (most static) data in dozens of X source
files only to force gcc 2.2.2 to put it to .data section.

Does anybody know a better solution? Perhaps changing the init code
for the target shared library? But how? 
Or can I hope for a gcc 2.2.3 with a option "-fput-uninitialized-to-data"?

Any help is greatly appreciated
-- Thomas

  Thomas Wolfram
  European Advanced Networking Test Center
  (Process Computing Center, Technical University of Berlin)
  Voice   : +49 030 31421294
  Internet: wolf@prz.tu-berlin.de
Technical Details
Message-ID: <GPC7JJD@mailgzrz.tu-berlin.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!w250zrz.zrz.tu-berlin.de!wolfaajj

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,6a5f645de84dc155,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-09-25 06:09:54 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!w250zrz.zrz.tu-berlin.de!wolfaajj
From: wolfaajj@w250zrz.zrz.tu-berlin.de (Thomas Wolfram)
Subject: HELP: gcc2.2.2, SVR3 shared libs and static data
Message-ID: <GPC7JJD@mailgzrz.tu-berlin.de>
Sender: gnulists@ai.mit.edu
Organization: ZRZ der TU-Berlin
Distribution: gnu
Date: Fri, 25 Sep 1992 17:03:05 GMT
Lines: 33