Various changes for PIC code on ARM...
Wed Feb 24 06:57:00 GMT 1999
>My changes are modelled after the way the i386 guys did their PIC support. It
>seemed like the best way at the time, as they seemed to be driving the
>compiler/assembler/linker forward. How do the NetBSD guys mark a branch as
>having to go through the PLT, or whether something needs a GOT or GOTOFF
As I understand it the NetBSD assembler just makes all branches PLT-relative
when you tell it that you want PIC code. This is triggered by the -k flag
which GCC passes to it when -fpic is in use. Richard is right that this is
actually a rather neater way to do things and I don't think it should be hard
to arrange. Ditto for GOT on global data.
I don't think they draw any distinction between GOT and GOTOFF.
Most of the support for this is actually in GNU as already. Look at
tc_gen_reloc(), particularly the bits that say `#if 0 /* not needed */'. :-)
More information about the Gcc-patches