Article View: gnu.g++.bug
Article #865g++ 2.2.2 on HP710 puts extern const in wrong segment
From: Earl Locken
Date: Fri, 21 Aug 1992 22:19
Date: Fri, 21 Aug 1992 22:19
39 lines
1440 bytes
1440 bytes
g++ 2.2.2 on an HP 9000/710 imports "extern const" variables from
the $CODE$ segment, even class variables with constructors. The
definition of these variables is placed into the $DATA segement
(correctly). The final link will fail, but will work on a Sun3 or Sun4.
g++ 2.2.2 was created using "configure hp700".
Compile the following three small files on an HP 710 using "g++
-o loc loc1.C loc2.C". The compile will fail due to "Unsatisfied symbols:".
--------------- Cut here for loc.h ---------------------
class loc {
public:
int i;
loc() { i = 0; };
};
extern const loc x;
--------------- Cut here for loc1.C ---------------------
#include "loc.h"
const loc y;
main()
{
if (&y == &x) return 0;
}
--------------- Cut here for loc2.C ---------------------
#include "loc.h"
const loc x; /* Where we define "extern const loc x" */
--
Earl Locken earl@jade.ab.ca
Jade Simulations International
Technical Details
Message-ID:
<EARL.92Aug21151915@jsi-bwd.jade.ab.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!jade.ab.CA!earlShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!jade.ab.CA!earl From: earl@jade.ab.CA (Earl Locken) Subject: g++ 2.2.2 on HP710 puts extern const in wrong segment Message-ID: <EARL.92Aug21151915@jsi-bwd.jade.ab.ca> Sender: gnulists@ai.mit.edu Organization: Jade Simulations International, Inc., Calgary, AB, Canada Distribution: gnu Date: Fri, 21 Aug 1992 22:19:15 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 40