Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: "Jochen Küpper" <jochen@uni-duesseldorf.de>
Subject: trouble with 'external read only' in dynamic library - segv
Date: 1997/10/05	[thread overview]
Message-ID: <34379D50.41C6@uni-duesseldorf.de> (raw)


Dear All,

I am using g++ and libg++ for software development.


PROBLEM:
=3D=3D=3D=3D=3D=3D=3D=3D

I am trying to put some arrays into a library, one of the array is
defined as:

#include <string>
const string symbol[] =3D {  "  ",
			   "h ", "he", "li", "be", "b ",
			   "c ", "n ", "o ", "f ", "ne",
			   "na", "mg", "al", "si", "p ",
			   "s ", "cl", "ar"
};

If I put that into an object file archive, everything is working as
expected,
but if I create a dynamic link library, I get a segmatation fault
whenever I =

try to access the array. But the array is in the library:

'nm /usr/local/lib/libJochen.so.0.2 |grep masses'
masses                           | 0004398046251768 | R |
0000000000000152


'man nm' says
R - [Digital]  External read only


System:
=3D=3D=3D=3D=3D=3D=3D

'uname -a'
OSF1 bacchus.pc1.uni-duesseldorf.de V4.0 564 alpha

'g++ -v'
 gcc -v
Reading specs from
/usr/local/lib/gcc-lib/alpha-dec-osf4.0/2.7.2.3.f.1/specs
gcc version 2.7.2.3.f.1

'll /usr/local/lib/lib*++*' (snipped the beginning of the lines)
 /usr/local/lib/libg++.a
 /usr/local/lib/libg++.so -> libg++.so.2.7.2
 /usr/local/lib/libg++.so.2.7.2
 /usr/local/lib/libstdc++.a
 /usr/local/lib/libstdc++.so -> libstdc++.so.2.7.2
 /usr/local/lib/libstdc++.so.2.7.2

The same is happening on my Linux box at home - running Linux 2.0.20,
glibc-2.0.5, gcc-2.7.2.3
and libg++-2.7.2.8.

Any idea what I am doing wrong ?

Jochen


-----------------------------------------------------------------------
  Jochen K=FCpper

  Heinrich-Heine-Universit=E4t D=FCsseldorf     jochen@uni-duesseldorf.de=

  Institut f=FCr Physikalische Chemie I
  Universit=E4tsstrasse 1, Geb 26.43.02.19       phone ++49-211-8113681
  40225 D=FCsseldorf                             fax   ++49-211-8115195
  Germany             http://www-public.rz.uni-duesseldorf.de/~jochen
-----------------------------------------------------------------------



             reply	other threads:[~1997-10-05  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-05  4:00 Jochen Küpper [this message]
1997-10-06  4:00 ` trouble with 'external read only' in dynamic library - segv Martin Knoblauch
1997-10-06  4:00   ` Jochen Küpper
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox