What is Reloc section?

What is Reloc section?

reloc section is a list of places in the image where the difference between the linker assumed load address and the actual load address needs to be factored in.

What is Section in PE file?

PE File Sections The PE file specification consists of the headers defined so far and a generic object called a section. Sections contain the content of the file, including code, data, resources, and other executable information. Each section has a header and a body (the raw data).

How does a relocation table work?

Relocation procedure The linker reads segment information and relocation tables in the object files and performs relocation by: merging all segments of common type into a single segment of that type. referring to the relocation table to modify symbols so that they point to the correct run time addresses.

What are the instructions stored in PE file?

The basic unit of code or data within a PE or COFF file. For example, all code in an object file can be combined within a single section or (depending on compiler behavior) each function can occupy its own section. With more sections, there is more file overhead, but the linker is able to link in code more selectively.

What is PE editor?

Pe, short for Programmer’s Editor, is an open source text editor for the Be Operating System (BeOS), Haiku and other BeOS-like operating systems. It is targeted towards source-code editing, and features syntax highlighting for a large number of programming languages.

How is a RELOC file related to a PE file?

The RELOC development files are related to Microsoft Windows. RELOC file is a Windows PE Relocation Section. The .reloc section holds a table of base relocations. A base relocation is an adjustment to an instruction or initialized variable value that’s needed if the loader couldn’t load the file where the linker assumed it would.

Which is relocation table does PE loader use?

IMAGE_BASE_RELOCATION is a data structure which can be expressed as: PE files don’t use IMAGE_BASE_RELOCATION structure to work, PE loader (dynamic linker) use it for constructing relocation table. You can read this topic if you want to learn more about relocation table.

What does a RELOC file do in Windows?

RELOC file is a Windows PE Relocation Section. The .reloc section holds a table of base relocations. A base relocation is an adjustment to an instruction or initialized variable value that’s needed if the loader couldn’t load the file where the linker assumed it would. Naturally, other applications may also use the .reloc file extension.

When do you need a base relocation table?

One of the sections, that may exist, is the .reloc section, and within this section is a base relocation table. The base relocation table is needed to fix up virtual addresses in the PE file if the PE file not was loaded at its preferred load address. In this post, I will have a look at a base relocation table and see what’s going on there.