Clarify R_386_GOT32 and R_386_GOT32X relocations

82 vues
Accéder directement au premier message non lu

H.J. Lu

non lue,
21 juin 2016, 12:36:2721/06/2016
à IA32 System V Application Binary Interface
Hi,

I updated Intel386 psABI to specify how to compute R_386_GOT32
and R_386_GOT32X relocations without base register and with PIC
disabled in

op name@GOT, %reg
op %reg, name@GOT

The updated psABI draft is at

https://github.com/hjl-tools/x86-psABI/wiki/intel386-psABI-draft.pdf

and on hjl/x86/got32 branch.


--
H.J.

H.J. Lu

non lue,
23 mars 2017, 14:18:2423/03/2017
à IA32 System V Application Binary Interface
"name@GOT" is a memory operand. It is usually computed as "G + A" to
get the GOT address. When used with lea, "lea name@GOT, %reg", it is
used to get the GOT index and should always be computed as G + A - GOT:

https://sourceware.org/bugzilla/show_bug.cgi?id=21168

I am checking in this patch.


--
H.J.
0001-Always-compute-R_386_GOT32-as-G-A-GOT-for-lea.patch

Rafael Espíndola

non lue,
30 mars 2017, 15:50:0330/03/2017
à ia32...@googlegroups.com
On 23 March 2017 at 14:18, H.J. Lu <hjl....@gmail.com> wrote:
> On Tue, Jun 21, 2016 at 9:36 AM, H.J. Lu <hjl....@gmail.com> wrote:
>> Hi,
>>
>> I updated Intel386 psABI to specify how to compute R_386_GOT32
>> and R_386_GOT32X relocations without base register and with PIC
>> disabled in
>>
>> op name@GOT, %reg
>> op %reg, name@GOT
>>
>> The updated psABI draft is at
>>
>> https://github.com/hjl-tools/x86-psABI/wiki/intel386-psABI-draft.pdf
>>
>> and on hjl/x86/got32 branch.
>>
>
> "name@GOT" is a memory operand. It is usually computed as "G + A" to
> get the GOT address. When used with lea, "lea name@GOT, %reg", it is
> used to get the GOT index and should always be computed as G + A - GOT:

It is unusual for a relocation expression to depend on where it is
found in the object file. What was the rationale for not introducing a
new relocation and having the assembler use that when appropriate?

Thanks,
Rafael

H.J. Lu

non lue,
3 avr. 2017, 15:21:1703/04/2017
à IA32 System V Application Binary Interface
At the time, I didn't realize that "lea name@GOT, %reg" was generated
by some compiler.


--
H.J.
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message