This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: PATCH: A testcase (Re: PATCH: A strang symbol versioning problem)


On Sun, Aug 11, 2002 at 03:07:52PM -0700, H. J. Lu wrote:
> On Sat, Aug 10, 2002 at 11:58:11PM -0700, H. J. Lu wrote:
> > On Sat, Aug 10, 2002 at 03:06:10PM -0700, H. J. Lu wrote:
> > > 
> > > Here is a small testcase
> > > 
> > > # make
> > > gcc  -B./ -g -fPIC   -c -o foo.o foo.c
> > > gcc: file path prefix `./' never used
> > > gcc  -B./ -g -fPIC   -c -o new.o new.c
> > > gcc: file path prefix `./' never used
> > > gcc  -B./ -Wl,--version-script=bar.map  -shared -o libnew.so new.o
> > > gcc: file path prefix `./' never used
> > > gcc  -B./ -shared -o libfoo.so -Wl,-rpath,. foo.o libnew.so
> > > gcc: file path prefix `./' never used
> > > gcc  -B./ -g -fPIC   -c -o old.o old.c
> > > gcc: file path prefix `./' never used
> > > gcc  -B./ -Wl,--version-script=bar.map  -shared -o libold.so old.o
> > > gcc: file path prefix `./' never used
> > > gcc  -B./ -o main -Wl,-rpath,. main.c libfoo.so libold.so new.o
> > > ./libnew.so(*IND*+0x0): multiple definition of `bar@VERS.0'
> > > libold.so(.text+0x12c): first defined here
> > > collect2: ld returned 1 exit status
> > > gcc: file path prefix `./' never used
> > > make: *** [main] Error 1
> > > 
> > > I will see what I can do.
> > 
> > The problem is the section pointer got changed across the call to
> > elf_merge_symbol. If the first call changes the section pointer to
> > undefined due to override, the next call to elf_merge_symbol will
> > be confused. I am enclosing a patch here. Do we expect/want the
> > section pointer gets changed after elf_add_default_symbol? Any
> > comments?
> > 
> > 
> 
> Here is the patch to add a testcase. I will take another look at my
> patch to make sure it is correct.
> 

I have convinced myself that my patch is correct. I will check it in
along with the testcase if I don't hear any objection in the next few
hours.


H.J.


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