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


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

Re: libc/936: glibc2 - ld.so fails to load a program defining



Just got this from the guy with the strcmp() problem, it' a new and
much less invasive patch.  I don't know the dynamic linker well enough
to evaluate it.  Comments?

zw

------- Forwarded Message

Date:    Mon, 01 Feb 1999 21:51:17 -0800
From:    Paul Pluzhnikov <paul@parasoft.com>
To:      zack@rabi.columbia.edu
Subject: Re: libc/936: glibc2 - ld.so fails to load a program defining

------- Start of forwarded message -------
Zak,

Here is the promised patch ...

It fixes the problem, and I think that it is correct
and non-performance affecting :-)

-------- cut here --------------------------------------------------
*** rtld.c.orig	Wed Jan 27 14:02:34 1999
--- rtld.c	Mon Feb  1 21:45:26 1999
***************
*** 986,993 ****
        {
  	/* There was an explicit ref to the dynamic linker as a shared lib.
  	   Re-relocate ourselves with user-controlled symbol definitions.  */
  	HP_TIMING_NOW (start);
! 	_dl_relocate_object (&_dl_rtld_map, _dl_loaded->l_scope, 0, 0);
  	HP_TIMING_NOW (stop);
  	HP_TIMING_DIFF (add, start, stop);
  	HP_TIMING_ACCUM_NT (relocate_time, add);
--- 986,1000 ----
        {
  	/* There was an explicit ref to the dynamic linker as a shared lib.
  	   Re-relocate ourselves with user-controlled symbol definitions.  */
+ 	
+ 	/* construct a special scope, where we resolve from ld.so
+ 	   first, and from default scope second, PR: libc/936 */
+ 	struct link_map *pmap = &_dl_rtld_map;
+ 	struct r_scope_elem sc = {&pmap, 1, 0, 0};
+ 	struct r_scope_elem *scope[3] = {&sc, _dl_loaded->l_scope[0], 0};
+ 
  	HP_TIMING_NOW (start);
! 	_dl_relocate_object (&_dl_rtld_map, scope, 0, 0);
  	HP_TIMING_NOW (stop);
  	HP_TIMING_DIFF (add, start, stop);
  	HP_TIMING_ACCUM_NT (relocate_time, add);
-------- cut here --------------------------------------------------


Cheers,
-- 
Paul Pluzhnikov		paul@parasoft.com
			626/305-0041 x352


------- End of Forwarded Message



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