This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: using relocs in disassembler
- To: Lynn Winebarger <owinebar at free-expression dot org>
- Subject: Re: using relocs in disassembler
- From: Alan Modra <alan at SPRI dot Levels dot UniSA dot Edu dot Au>
- Date: Tue, 16 Nov 1999 09:50:41 +1030 (CST)
- cc: binutils at sourceware dot cygnus dot com
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.