CFLAGS+= -fPIC per default?
marcel at xcllnt.net
Sun Feb 22 14:02:12 PST 2004
On Sun, Feb 22, 2004 at 02:27:34PM -0700, Joseph Fenton wrote:
> Sorry to be anal, but PC-relative addressing is by definition
> position-independent code.
The fundamental property of PIC , besides the fact that it's a
complete misnomer, is that there are no relocations in the code
segment. The operating system cannot share read-only segments if
the linker/loader has to modify it first to relocate it depending
on where segments are loaded in memory for each process. Across
processes the relative distance between two segments within the
same shared executable is not fixed. Therefore, PIC has not so
much to do with whether or not PC-relative addressing can be used
per se, as it has to do with how much the compiler/assembler knows
about the relative distance between addresses. In practice this
is not as much as it seems due to the tendency to make the unit
of compilation smaller.
> Sorry to nit-pick like this, but having worked on both Mac
> and Amiga ROMs, PIC mode under BSD really seems
> backwards to me.
It's no different than PIC on other OSes.
Marcel Moolenaar USPA: A-39004 marcel at xcllnt.net
More information about the freebsd-amd64