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]

Re: The ia64 linker problems.


On Mon, Feb 05, 2001 at 03:23:44PM -0800, H . J . Lu wrote:
> I found a few ia64 linker problems. One of them is I cannot overide
> functions in DSO from the executables:
> 
> # make
> cc -O -B./  -c main.c
> cc: file path prefix `./' never used
> cc -O -B./  -fPIC -c sh1.c
> cc: file path prefix `./' never used
> cc -shared -o libfoo.so -O -B./  -fPIC sh1.o
> cc: file path prefix `./' never used
> cc -o foo -O -B./  main.o libfoo.so -Wl,-rpath,.
> cc: file path prefix `./' never used
> for f in foo; do echo "Running: $f"; ./$f; \
>   if [ $? != 0 ]; then echo Failed; fi; done
> Running: foo
> shlib_shlibcall2 () == 7
> shlib_overriddencall2 () == 8
> Failed
> 

I think I found the problem:

# gcc -c sh1.c -fPIC
# readelf -a sh1.o | grep shlib_overriddencall2
     9: 0000000000000060     0 FUNC    GLOBAL DEFAULT    1 shlib_overriddencall2

There is no relocation for shlib_overriddencall2. I believe the assembler is
wrong. It can only optimize out the relocation iff the symbol is local.


-- 
H.J. Lu (hjl@valinux.com)

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