Related articles |
---|
Understanding relocation information heyji2@gmail.com (AG) (2010-03-08) |
Re: Understanding relocation information kaxosan@gmail.com (Kamil Konieczny) (2010-03-10) |
From: | Kamil Konieczny <kaxosan@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Wed, 10 Mar 2010 03:44:25 -0800 (PST) |
Organization: | Compilers Central |
References: | 10-03-016 |
Keywords: | linker |
Posted-Date: | 10 Mar 2010 12:56:29 EST |
On Mar 8, 11:28 am, AG <hey...@gmail.com> wrote:
> Hi,
>
> I am trying to understand how relocation information in PE/COFF files
> work, and I am half the way. For PE files, everything is in the .reloc
> section, and as far as I read the PE file specifications (provided by
> microsoft on their web site) I am fine. But for Object files, I don't
> really understand the specifications, and I would appreciate if
> someone could help me.
> [...]
> IMAGE_REL_I386_DIR32 0x0006 The target's 32-bit VA.
> IMAGE_REL_I386_DIR32NB 0x0007 The target's 32-bit RVA.
> [...]
> In these lines, I don't understand what the word "target" is referring
> to ? Neither do I understand the sentence themselves. For instance
> what should I do with "The target's 32-bit VA" ? How does it relates
> with my equation A = f(B) ?
for each relocation type, you can have different 'f' function
or you can have different target calc
spec should give details
> [The target is B, the address value that is supposed to be stored at
> A. Actually, it's more like A += f(B). -John]
there is Matt Pietrek old book with examples,
regards,
Kamil
[There is, of course, also my "Linkers and Loaders" which has a section on PE, but
perhaps not at the level of detail needed here. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.