From dc83f2d20e964f9a7fd9a97ba9d3950b908752a1 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 2 Mar 2021 12:06:14 +1030 Subject: Split relocation defines out of coff/internal.h include/ * coff/internal.h: Delete obsolete relocation defines. Move used relocation defines.. * coff/i386.h: ..to here.. * coff/ti.h: ..and here.. * coff/x86_64.h: ..and here.. * coff/z80.h: ..and here.. * coff/z8k.h: ..and here. bfd/ * reloc.c: Include x86_64.h rather than internal.h. --- include/coff/x86_64.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include/coff/x86_64.h') diff --git a/include/coff/x86_64.h b/include/coff/x86_64.h index 583b7df..4d3e6e7 100644 --- a/include/coff/x86_64.h +++ b/include/coff/x86_64.h @@ -75,3 +75,32 @@ struct external_reloc #define RELOC struct external_reloc #define RELSZ 10 + +/* X86-64 relocations. */ +#define R_AMD64_ABS 0 /* Reference is absolute, no relocation is necessary. */ +#define R_AMD64_DIR64 1 /* 64-bit address (VA). */ +#define R_AMD64_DIR32 2 /* 32-bit address (VA) R_DIR32. */ +#define R_AMD64_IMAGEBASE 3 /* 32-bit absolute ref w/o base R_IMAGEBASE. */ +#define R_AMD64_PCRLONG 4 /* 32-bit relative address from byte following reloc R_PCRLONG. */ +#define R_AMD64_PCRLONG_1 5 /* 32-bit relative address from byte distance 1 from reloc. */ +#define R_AMD64_PCRLONG_2 6 /* 32-bit relative address from byte distance 2 from reloc. */ +#define R_AMD64_PCRLONG_3 7 /* 32-bit relative address from byte distance 3 from reloc. */ +#define R_AMD64_PCRLONG_4 8 /* 32-bit relative address from byte distance 4 from reloc. */ +#define R_AMD64_PCRLONG_5 9 /* 32-bit relative address from byte distance 5 from reloc. */ +#define R_AMD64_SECTION 10 /* Section index. */ +#define R_AMD64_SECREL 11 /* 32 bit offset from base of section containing target R_SECREL. */ +#define R_AMD64_SECREL7 12 /* 7 bit unsigned offset from base of section containing target. */ +#define R_AMD64_TOKEN 13 /* 32 bit metadata token. */ +#define R_AMD64_PCRQUAD 14 /* Pseude PC64 relocation - Note: not specified by MS/AMD but need for gas pc-relative 64bit wide relocation generated by ELF. */ + +/* i386 Relocations. */ + +#define R_DIR32 6 +#define R_IMAGEBASE 7 +#define R_SECREL32 11 +#define R_RELBYTE 15 +#define R_RELWORD 16 +#define R_RELLONG 17 +#define R_PCRBYTE 18 +#define R_PCRWORD 19 +#define R_PCRLONG 20 -- cgit v1.1