atexit in _init_libc

Hello again!
I have been digging deeper into gdb and found some more interesting
stuff.
I was able to dump all defined variables in scope right after the SEGV.
And here it is…
(gdb) info variables
All defined variables:

File testme.cpp:
static char *Xerces_DLLName;
static int express;
static char *gXercesFullVersionStr;
static unsigned int gXercesMajVersion;
static unsigned int gXercesMinVersion;
static unsigned int gXercesRevision;
static char *gXercesVersionStr;

Non-debugging symbols:
0804843c _init
0804845c __throw
0804846c ostream::operator<<(char const *)
0804847c __deregister_frame_info
0804848c _init_libc
0804849c atexit
080484ac exit
080484bc __register_frame_info
080484cc _btext
080484d4 _start
0804852c __do_global_dtors_aux
08048594 fini_dummy
080485ac frame_dummy
080485e4 init_dummy
08048628 func1(void)
08048638 __do_global_ctors_aux
0804866c init_dummy
08048684 _fini


Now, Non-debugging symbols looks a little like a backtrace in the stack to
me…??
And, it looks to me like libc is not getting fired up and infact it appears
to die in _init_libc??
That’s pretty nasty, also when I do a ‘info meminfo’ in gdb I see all the
‘NEEDED’
libraries for libxerces-c1_6_0.so loaded except libc.so, hence telling me
that libc indeed isn’t waking up properly.

All this program does is link in libxerces-c1_6_0 but never calls anything
in it,
in fact here’s the program:

#include

using namespace std;

int func1();
const int express = 234;

int
main()
{
cerr << “Error output\n”;
return 1;
}

int
func1()
{
return 5;
}

So, those are my latest discoveries, any feedback is always welcome. Any
ideas
why libc.so might be initalizing properly?
TIA,
Kevin

I nailed it!
Needed to add a -fPIC to the compiler flags. Funny thing, I had it in there
before
but it some how fell out of my Makefile.incl



“Kevin Caporaso” <kcaporaso@pillardata.com> wrote in message
news:afpv9a$j1l$1@nntp.qnx.com

Hello again!
I have been digging deeper into gdb and found some more interesting
stuff.
I was able to dump all defined variables in scope right after the SEGV.
And here it is…
(gdb) info variables
All defined variables:

File testme.cpp:
static char *Xerces_DLLName;
static int express;
static char *gXercesFullVersionStr;
static unsigned int gXercesMajVersion;
static unsigned int gXercesMinVersion;
static unsigned int gXercesRevision;
static char *gXercesVersionStr;

Non-debugging symbols:
0804843c _init
0804845c __throw
0804846c ostream::operator<<(char const *)
0804847c __deregister_frame_info
0804848c _init_libc
0804849c atexit
080484ac exit
080484bc __register_frame_info
080484cc _btext
080484d4 _start
0804852c __do_global_dtors_aux
08048594 fini_dummy
080485ac frame_dummy
080485e4 init_dummy
08048628 func1(void)
08048638 __do_global_ctors_aux
0804866c init_dummy
08048684 _fini


Now, Non-debugging symbols looks a little like a backtrace in the stack to
me…??
And, it looks to me like libc is not getting fired up and infact it
appears
to die in _init_libc??
That’s pretty nasty, also when I do a ‘info meminfo’ in gdb I see all the
‘NEEDED’
libraries for libxerces-c1_6_0.so loaded except libc.so, hence telling me
that libc indeed isn’t waking up properly.

All this program does is link in libxerces-c1_6_0 but never calls anything
in it,
in fact here’s the program:

#include <iostream

using namespace std;

int func1();
const int express = 234;

int
main()
{
cerr << “Error output\n”;
return 1;
}

int
func1()
{
return 5;
}

So, those are my latest discoveries, any feedback is always welcome. Any
ideas
why libc.so might be initalizing properly?
TIA,
Kevin