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: RFC: Is it OK to disassemble instructions twice ?


* Tamar Christina:

> I was trying to figure out for which target this is actually. Do we
> have any targets where the relocations aren't set at the start of the
> symbol?

x86-64 has this property.  The relocation is located where the value
needs to be patched in, not the start of the instruction.  Otherwise,
the architecture would need many, many more relocation types.

Nick, doubling the diassembly cost is rather excessive.  It is quite
slow already, reducing its usefulness.

Would it be possible to add a hook which decodes the size of the
instruction first, then does the relocation processing, and then
disassembles the instruction (passing the already-computed size for
convenience, perhaps)?

Or maybe you could add a per-target maximum instruction length and do
the double-disassembly only if there is a relocation within the maximum
instruction length window.

Thanks,
Florian


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