This is the mail archive of the binutils@sourceware.org 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: R_386_32 relocations with sym-value=0 ?


On Mon, Aug 16, 2010 at 04:54:56PM +0200, Nils Asmussen wrote:
> To come back to the subject: Currently I'm building the libstdc++.so
> with:
> i586-elf-escape-ld -shared -soname libstdc++ -o libstdc++.so <object
> files> -lc
> 
> I don't know if thats the problem. When I try to build it with g++, as
> one would normally do:
> i586-elf-escape-g++ -shared -nostartfiles -nostdlib -Wl,-soname,libstdc
> ++ -o libstdc++.so <object files> -lc

You won't get a fully working shared libstdc++ with either of these
command lines.  Without startup files, how do you run any
initialization functions in libstdc++?

> - Can it actually happen that symbols relocated as R_386_32 have a value
> of 0

Zero isn't a special value.  If a sym is undefined that's the usual
value.  You are likely getting these relocs because you are trying to
build a shared lib without -fPIC or -fpic.  That's a bad idea for two
reasons:
1) non-PIC will give you relocations in text, which will result in
   non-shared pages, and
2) gcc will generate code that does not satisfy ELF shared library
   semantics.

-- 
Alan Modra
Australia Development Lab, IBM


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