Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclscu!shankar From: shankar@hpclscu.HP.COM (Shankar Unni) Newsgroups: comp.sys.hp Subject: Re: Static data problems in Motif Application Message-ID: <1340136@hpclscu.HP.COM> Date: 22 Aug 90 20:09:01 GMT References: <12319@netcom.UUCP> Organization: Hewlett-Packard Calif. Language Lab Lines: 30 > From the map that is generated by the -Wl,-m option, I can see that > static data is located in the $THIS_DATA areas. What's interesting is > that $THIS_DATA$ sometimes have many of them that shared the same > address. Does anyone know what this means? The easy question first (:-)): To reduce the load on the linker, the C compiler gathers all statics in a compilation unit together, and assigns them one symbol, and all loads and stores of these statics are done with an appropriate offset off this symbol. Two such symbols are generated: "$THIS_DATA$" for initialized statics, and "$THIS_BSS$" for uninitialized statics (these go into the data and BSS areas, respectively). About the other problems, the only thing that I can suggest immediately is to contact an HP response center and let them take a crack at it.. (your static problem may be due to some startup code in main() trashing your data. You mentioned "first statement in main". What would be in that first statement? Another thing would be to start up xdb and go into assembly mode ("td"). Single-step till you hit the first instruction of main, and then look at the static (i.e. before any code under main() has run). If it is trashed at that point, then you have a deeper problem... ----- Shankar Unni E-Mail: Hewlett-Packard California Language Lab. Internet: shankar@hpda.hp.com Phone : (408) 447-5797 UUCP: ...!hplabs!hpda!shankar