Wrong object file generated with -fPIC option 2.17 ported to Interix
Nick Clifton
nickc@redhat.com
Fri Sep 21 08:03:00 GMT 2007
Hi Mayank,
> An object file generated using -fPIC option has undefined symbols like the following:-
> U L10@GOTOFF
> U L12@GOTOFF
> I also found that this is happening in the assembly phase. I did the following:-
> gcc -S -fPIC file.c
> as -o file.o file.s
>
> The object file generated have all the above as undefined symbol.
Just to be clear - it is gcc that is generating the references to these
symbols, not the assembler. If you look at "file.s" you should see them there.
> I want to know what part of assembler or bfd code resolves these
> labels so that I can debug more to find out why these undefined
> symbols are getting generated.
The "@GOTOFF" part of the symbol is a directive to the assembler telling it how
the relocation for the symbol's value should be generated. See the function
lex_get() in gas/config/tc-i386.c
Cheers
Nick
More information about the Binutils
mailing list