[parisc-linux] dynamic loader problem

Randolph Chung Randolph Chung <randolph@tausq.org>
Sat, 6 Apr 2002 09:54:52 -0800


In reference to a message from John David Anglin, dated Mar 11:
> In looking at the the failure of the g++.brendan/new3.C, I have observed
> what appears to be a problem with the dynamic loader.  The function
> _Znwj appears as a global symbol in the main program and in
> libstdc++.so.4.0.0.  The version in the main program should be selected
> in preference to the one in the shared library.  However, the dynamic
> loader actually uses the version in the shared library causing the
> test to fail.  The program works ok with static linkage.
> 
> It looks like the symbol search procedure used in glibc needs some work.

ok, recently events have prompted me to look at this again...

isn't the test itself broken?

it does this:

void *operator new(size_t sz) .....

int main() 
{
  A *bb = new A[10]; 
  ...
}

you define "operator new", but are calling operator new[], so it
defaults to the one in libstdc++...

if you change the definition of "operator new" to "operator new[]" then
the test will pass.

randolph
-- 
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^