This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: using relocs in disassembler


On Mon, 15 Nov 1999, Lynn Winebarger wrote:

> relocs.  First let me see if my assumption about static relocs can be
> verified: a reloc affects at most one immediate operand of an

You could have more than one reloc affecting an instruction. eg. x86
"movl $addr1,addr2"  Other architectures may allow even more (vax ?)

> instruction.  Thus I don't need to worry about the size of a reloc, I can
> just let the disassembler get the operand as normal, and then just ignore
> it (except for the size).  
>    Now, I guess my question also applies to some static relocs: when a
> reloc appears in data, how can I tell how much data is taken up by the
> reloc, and exactly what I should replace it with.  I'm guessing, if it's
> data, the data would become a pointer to the symbol (or the value of the
> symbol).  

Think of a reloc record as just being a formula telling you how to modify
existing instruction or data bytes.  As far as I know, a reloc never
changes the size of an instruction in an object file.


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