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


> 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.

hrm, i see....

> 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?

yeah, seems a bit bogus :) i think it works only because export stubs
normally occur earlier in a file than the real function; but i suppose
that doesn't have to be the case.

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

ok, thanks. your patch looks good; i'm still wondering if we should have
unified logic to search for (export|import) stubs... but that's for
later.

thanks,
randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


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