This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: R_386_32 relocations with sym-value=0 ?
- From: Alan Modra <amodra at gmail dot com>
- To: Nils Asmussen <nils at script-solution dot de>
- Cc: binutils at sourceware dot org
- Date: Tue, 17 Aug 2010 12:12:29 +0930
- Subject: Re: R_386_32 relocations with sym-value=0 ?
- References: <1281970496.9234.45.camel@hrniels-desktop>
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