H.J. Lu
unread,Oct 15, 2015, 11:54:48 AM10/15/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to IA32 System V Application Binary Interface
X86 instruction encoding supports converting some instructions on memory
operand with GOT32 relocation against symbol, foo, into a different
form on immediate operand if foo is defined locally. Those instructions
are:
call *foo@GOT[(%reg)] => nop call foo or call foo nop
jmp *foo@GOT[(%reg)] => jmp foo nop
mov foo@GOT[(%reg1)], %reg2 => lea foo[@GOTOFF(%reg1)], %reg2
When osition-independent code is disable,
test %reg1, foo@GOT[(%reg2)] => test $foo, %reg1
binop foo@GOT[(%reg1)], %reg2 => binop $foo, %reg2
where binop is one of adc, add, and, cmp, or, sbb, sub, xor instructions.
I am proposing to add a new relocation, R_386_GOT32X, to i386 psABI.
Instead of generating R_386_GOT32 relocation agasint foo for
foo@GOT(%reg), we generate R_386_GOT32X. R_386_GOT32X relocation can
also be used without the base register for the global offset table,
foo@GOT, when position-independent code is disable. In this case, the
static base address of the global offset table will be used instead.
Linker can treat R_386_GOT32X the same as R_386_GOT32 or it can perform
the transformations listed above.
--
H.J.