Using and Porting GNU CC
This section describes macros that help implement generation of position
independent code. Simply defining these macros is not enough to
generate valid PIC; you must also add support to the macros
LEGITIMIZE_ADDRESS. You must modify the definition of
movsi' to do something appropriate when the source operand
contains a symbolic address. You may also need to alter the handling of
switch statements so that they use relative addresses.
PIC_OFFSET_TABLE_REGNUMis clobbered by calls. Do not define this macro if
PPIC_OFFSET_TABLE_REGNUMis not defined.
FINALIZE_PIC macro serves as a hook to emit these special
codes once the function is being compiled into assembly code, but not
before. (It is not done before, because in the case of compiling an
inline function, it would lead to multiple PIC prologues being
included in functions which used inline functions and were compiled to
CONSTANT_P, so you need not check this. You can also assume flag_pic is true, so you need not check it either. You need not define this macro if all constants (including
SYMBOL_REF) can be immediate operands when generating position independent code.