Re: Understanding relocation information

Kamil Konieczny <>
Wed, 10 Mar 2010 03:44:25 -0800 (PST)

          From comp.compilers

Related articles
Understanding relocation information (AG) (2010-03-08)
Re: Understanding relocation information (Kamil Konieczny) (2010-03-10)
| List of all articles for this month |

From: Kamil Konieczny <>
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 <> 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,

[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]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.