This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/hpux] SEGV when running program using dlopen


> since we are already doing this in an ALL_OBJFILES loop, how come we
> don't find the right symbol?

The answer is in the body of lookup_minimal_symbol_solib_trampoline().

It iterates over all msymbols of the objfile, and returns the first
one whose name matches *and* whose ``MSYMBOL_TYPE (msymbol) ==
mst_solib_trampoline''. See minsyms.c, around line 353.

Since in our case, the symbol we're looking for is not inside
a shared library, the lookup always fails.

I was also wondering whether the current code might be working
by pure luck in the other case. Assuming that the objfile contains
two symbols (one stub, one function) in the shared library, what
guaranty do we have that the lookup will find the one we're looking
for?

> i also notice that the problem only occurs when you link in end.o;
> what does that do?

AFAIK, it provides some help in debugging by exporting some specified
symbols. The only use I know of if with shared libraries...

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]