This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

relocation dependencies


I've checked in patches to fix ld.so to handle the case for which I
checked in a test yesterday.  ld.so now tracks dependencies introduced
by relocations.  Example:

	main dlopen()s with RTLD_GLOBAL

		liba
		libb

	liba defines
		foo

	libb defines
		bar
	bar in libb needs
		foo

If now the main program calls bar in libb the reference to foo gets
resolved with the foo in liba.

Formerly, if now liba gets unloaded, following calls to bar leads to a
segfault since the jump to foo ends in nirvana.  Now liba does not
actually get removed until libb also gets removed.

To see it actually works run the test case in dlfcn with LD_DEBUG=files.

Fortunately I didn't have to change much.  Most of the work was done
when I added the debug messages quite some time back.  We also can
avoid the expensive work to add the dependency by some cheap tests so
that the overall penalties of introducing this feature are very low.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

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