[RFA/hpux] SEGV when running program using dlopen

Randolph Chung tausq@debian.org
Wed Dec 15 17:27:00 GMT 2004

> 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

Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports

More information about the Gdb-patches mailing list