<div dir="ltr">But how do you know whether a R_386_GOT32 has a base register or not by looking at the location where a relocation is applied? IIUC, your old spec doesn't impose any restrictions on where you can use R_386_GOT32, so you can use that type of relocation anywhere. Even if it the location where a R_386_GOT32 looks like a 386 instruction, that could still be some other kind of data.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 3:13 PM, H.J. Lu <span dir="ltr"><<a href="mailto:hjl.tools@gmail.com" target="_blank">hjl.tools@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Mar 30, 2017 at 3:01 PM, Rafael Espíndola<br>
<span class=""><<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
> On 30 March 2017 at 17:59, H.J. Lu <<a href="mailto:hjl.tools@gmail.com">hjl.tools@gmail.com</a>> wrote:<br>
>> On Thu, Mar 30, 2017 at 2:52 PM, Rafael Espíndola<br>
>> <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
>>> On 30 March 2017 at 17:45, H.J. Lu <<a href="mailto:hjl.tools@gmail.com">hjl.tools@gmail.com</a>> wrote:<br>
>>>> On Thu, Mar 30, 2017 at 2:40 PM, Rafael Espíndola<br>
>>>> <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
>>>>>>> 08048074 <_start>:<br>
>>>>>>>  8048074: c7 c0 74 80 04 08     mov    $0x8048074,%eax<br>
>>>>>>><br>
>>>>>>> as the GOT entry for _start contains the address of _start.<br>
>>>>>><br>
>>>>>> Even with trunk I get<br>
>>>>>><br>
>>>>>> 08048094 <_start>:<br>
>>>>>>  8048094:       a1 fc ff ff ff          mov    0xfffffffc,%eax<br>
>>>>><br>
>>>>> And I still get -4 with the head of the binutils-2_28-branch branch.<br>
>>>>><br>
>>>><br>
>>>> The updated i386 psABI requires to encode "mov _start@GOT, %eax" with<br>
>>>> 0x8b opcode with R_386_GOT32X instead of 0xa1 opcode.<br>
>>><br>
>>> What about files produced by old assemblers?<br>
>><br>
>> For the older .o files, G + A - GOT is used.<br>
><br>
> Which is incorrect?<br>
><br>
> The current ABI also lists  R_386_GOT32 with the same expression as<br>
> R_386_GOT32X. When is a R_386_GOT32 required to be evaluated as G + A?<br>
><br>
<br>
</span>And it also says 0x8b opcode should be used.  For R_386_GOT32 without<br>
a base register on a1 opcode, it is undefined.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
H.J.<br>
</font></span></blockquote></div><br></div>