This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/5] Add support for R_386_GOT32X/R_X86_64_[REX_]GOTPCRELX


On Mon, Jan 18, 2016 at 01:16:35PM -0500, Rafael Espíndola wrote:
> It needs to convert an 0x8b to an 0x8c. So I guess the unwritten
> requirement of R_X86_64_GOTPCREL is that it can only be used at least
> 2 bytes after the start of an actual instruction, and not, for
> example, in a table:
> 
> bar:
>         .byte 0x8b
>         .byte 0x42
>         .long bar@GOTPCREL

It's worse than that.  You generally can't find the start of an x86
instruction from the relocation offset.  If you scan backwards, a byte
that looks like a prefix may in fact just be part of the previous insn
immediate or other fields.

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]