Mohamed Atef
Mohamed Atef

Reputation: 13

COFF x86_64 relocation types

I am working on linker development for an open source project. The target architecture is AMD_X86_X64. In AMD_X86_X64 specification The relocation types' calculations for ELF are declared for example, R_X86_64_64 the calculation is S + A. How to do these calculations in COFF I can't find them online ?

Upvotes: 0

Views: 537

Answers (1)

vitsoft
vitsoft

Reputation: 5775

COFF relocation types are enumerated at COFF Relocations for x64.

IMAGE_REL_AMD64_ABSOLUTE corresponds with R_X86_X64_COPY (no relocation),
IMAGE_REL_AMD64_ADDR64 corresponds with R_X86_X64_64 (S+A),
IMAGE_REL_AMD64_ADDR32 corresponds with R_X86_X64_32 (S+A),
IMAGE_REL_AMD64_REL32 corresponds with R_X86_X64_PC32 (S+A-P).

Upvotes: 1

Related Questions