Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / as / README.pic
1 A few short notes on PIC support.
2
3 . References to the symbol "_GLOBAL_OFFSET_TABLE_" are special. These always
4   PC relative to the start of the current instruction. Also, they occur
5   in "complex" expressions in function prologs, eg.
6
7         move    _GLOBAL_OFFSET_TABLE_ + (. - L1 ), %some_register
8
9   The expression parser can't handle these generically, so the expression
10   above is recognised as a special case.
11
12 . Some archs have special PIC assembler syntax to reference static and global
13   data. This is handled in targ-cpu.c.
14
15 . Correct relocation_info must be output (eg. fields r_jmptable and r_baserel).
16
17 . Internal labels must be output in the symbol table if they are referred to
18   by PIC instructions. The linker must allocate a GOT slot for them.
19  
20 . The former meaning of the -k switch ("WORKING_DOT" stuff), has been nuked
21   in favour of enabling PIC code recognition.
22
23
24 -pk
25