[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/21285] R_386_GOT32 for baseless case looks implemented incorre
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/21285] R_386_GOT32 for baseless case looks implemented incorrectly. |
Date: |
Mon, 15 May 2017 15:07:25 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=21285
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Cary Coutant from comment #2)
> OK, suppose we have the following sequence of instructions:
>
> cmp $0x8b, %al
> movl address@hidden, %eax
> mov address@hidden(%ecx), %esp
>
> which assemble to:
>
> 0: 3c 8b cmp $0x8b,%al
> 2: a1 00 00 00 00 mov 0x0,%eax
> 7: 8b a1 00 00 00 00 mov 0x0(%ecx),%esp
>
> How is the linker supposed to distinguish the two mov instructions? We
> cannot make this optimization based on looking at the opcodes -- we need
> separate relocations to tell us which is which, unless it's OK to invalidate
> 0xa1 as a valid modrm byte in this usage.
>
> Doesn't ld have the same problem?
movl address@hidden, %eax
is only supported with the updated i386 psABI, which requires
"mov address@hidden, %eax must be encoded with opcode 0x8b, not 0xa0,
to allow linker optimization."
--
You are receiving this mail because:
You are on the CC list for the bug.