<html><head></head><body>Awesome. George, please update the change so both relocations are treated the same way.<br>
<br>
Cheers,<br>
Rafael<br><br><div class="gmail_quote">On March 31, 2017 11:22:02 AM EDT, "H.J. Lu" <<a href="http://hjl.tools">hjl.tools</a>@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Fri, Mar 31, 2017 at 8:01 AM, Rafael Espíndola<br /><rafael.espindola@gmail.com> wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> [hjl@gnu-6 tmp]$ cat y.s<br /> .text<br /> .globl _start<br /> _start:<br /> cmp %eax, _start@GOT<br /> [hjl@gnu-6 tmp]$ gcc -m32 -c y.s<br /> [hjl@gnu-6 tmp]$ objdump -dwr y.o<br /><br /> y.o:     file format elf32-i386<br /><br /><br /> Disassembly of section .text:<br /><br /> 00000000 <_start>:<br />    0: 39 05 00 00 00 00     cmp    %eax,0x0 2: R_386_GOT32 _start<br /> [hjl@gnu-6 tmp]$ ld -m elf_i386 y.o<br /> [hjl@gnu-6 tmp]$ objdump -dw a.out<br /><br /> a.out:     file format elf32-i386<br /><br /><br /> Disassembly of section .text:<br /><br /> 08048094 <_start>:<br />  8048094: 39 05 fc 9f 04 08     cmp    %eax,0x8049ffc<br /> [hjl@gnu-6 tmp]$<br /><br /> In this case, R_386_GOT32 is computed as G + A, not G + A - GOT.<br /></blockquote><br /> OK, the current situation with gas and bfd ld is somewhat amusing. Given<br /><br /> mov _start@GOT, %eax<br /> cmp _start@GOT, %eax<br /><br /> assembled with an old gas we get two R_386_GOT32. After linking, the result is<br /><br />  8048094:       a1 fc ff ff ff          mov    0xfffffffc,%eax<br />  8048099:       3b 05 fc 9f 04 08       cmp    0x8049ffc,%eax<br /><br /> Would it be ok in your opinion then for an implementation to treat<br /> R_386_GOT32X as just a relaxable R_386_GOT32 but unlike bfd produce<br /> G+A for both the mov and cmp above?</blockquote><br /><br />It is OK.<br /></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>