]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Split relocation defines out of coff/internal.h
authorAlan Modra <amodra@gmail.com>
Tue, 2 Mar 2021 01:36:14 +0000 (12:06 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 3 Mar 2021 07:16:24 +0000 (17:46 +1030)
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.

bfd/ChangeLog
bfd/reloc.c
include/ChangeLog
include/coff/i386.h
include/coff/internal.h
include/coff/ti.h
include/coff/x86_64.h
include/coff/z80.h
include/coff/z8k.h

index a056a146288b8d4ff2a5ddb1841796787e7b49bc..0e518ceb34db1d9bd5f63e066028ebc939e187ad 100644 (file)
@@ -1,3 +1,7 @@
+2021-03-03  Alan Modra  <amodra@gmail.com>
+
+       * reloc.c: Include x86_64.h rather than internal.h.
+
 2021-03-02  Nick Clifton  <nickc@redhat.com>
 
        PR 27484
index 4f4b95a0b7ff11bd24ab0e0b9550801730cac6f9..a7547187ebeef370fb8cd29301225e55fd7fcd22 100644 (file)
@@ -51,7 +51,7 @@ SECTION
 #include "bfdlink.h"
 #include "libbfd.h"
 #include "bfdver.h"
-#include "coff/internal.h"
+#include "coff/x86_64.h"
 /*
 DOCDD
 INODE
index d287b78870fad335c26df92f9265c836d55d8e55..7c53c21b9c39165c3129fe3d974c5671d0ba87eb 100644 (file)
@@ -1,3 +1,13 @@
+2021-03-03  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-api.h (CTF_LINK_SHARE_DUPLICATED): Note that this might
index 4372194ba47088879e877dccb12ac2a3b4cb23bd..dd2eda1bd4a2a95dddfc1801119f5b26f3b268e2 100644 (file)
@@ -91,3 +91,14 @@ struct external_reloc
 #define RELOC struct external_reloc
 #define RELSZ 10
 
+/* 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
index 8e21b4ef3bcb27654e64f88aa7649a7f92807e95..165518135465c2ece1a20aa76afbfb8e03b3e0df 100644 (file)
@@ -668,146 +668,4 @@ struct internal_reloc
   unsigned long r_offset;      /* Used by Alpha ECOFF, SPARC, others */
 };
 
-/* 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_DIR16         1
-#define R_REL24          5
-#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
-#define R_PCR24         21
-#define R_IPRSHORT     24
-#define R_IPRLONG      26
-#define R_GETSEG       29
-#define R_GETPA        30
-#define R_TAGWORD      31
-#define R_JUMPTARG     32      /* strange 29k 00xx00xx reloc */
-#define R_PARTLS16      32
-#define R_PARTMS8       33
-
-#define R_PCR16L       128
-#define R_PCR26L       129
-#define R_VRT16        130
-#define R_HVRT16       131
-#define R_LVRT16       132
-#define R_VRT32        133
-
-
-/* This reloc identifies mov.b instructions with a 16bit absolute
-   address.  The linker tries to turn insns with this reloc into
-   an absolute 8-bit address.  */
-#define R_MOV16B1      0x41
-
-/* This reloc identifies mov.b instructions which had a 16bit
-   absolute address which have been shortened into a 8-bit
-   absolute address.  */
-#define R_MOV16B2      0x42
-
-/* This reloc identifies jmp insns with a 16bit target address;
-   the linker tries to turn these insns into bra insns with
-   an 8bit pc-relative target.  */
-#define R_JMP1         0x43
-
-/* This reloc identifies a bra with an 8-bit pc-relative
-   target that was formerly a jmp insn with a 16bit target.  */
-#define R_JMP2                 0x44
-
-/* ??? */
-#define R_RELLONG_NEG          0x45
-
-/* This reloc identifies jmp insns with a 24bit target address;
-   the linker tries to turn these insns into bra insns with
-   an 8bit pc-relative target.  */
-#define R_JMPL1        0x46
-
-/* This reloc identifies a bra with an 8-bit pc-relative
-   target that was formerly a jmp insn with a 24bit target.  */
-#define R_JMPL2                0x47
-
-/* This reloc identifies mov.b instructions with a 24bit absolute
-   address.  The linker tries to turn insns with this reloc into
-   an absolute 8-bit address.  */
-
-#define R_MOV24B1      0x48
-
-/* This reloc identifies mov.b instructions which had a 24bit
-   absolute address which have been shortened into a 8-bit
-   absolute address.  */
-#define R_MOV24B2      0x49
-
-/* An h8300 memory indirect jump/call.  Forces the address of the jump/call
-   target into the function vector (in page zero), and the address of the
-   vector entry to be placed in the jump/call instruction.  */
-#define R_MEM_INDIRECT 0x4a
-
-/* This reloc identifies a 16bit pc-relative branch target which was
-   shortened into an 8bit pc-relative branch target.  */
-#define R_PCRWORD_B    0x4b
-
-/* This reloc identifies mov.[wl] instructions with a 32/24 bit
-   absolute address; the linker may turn this into a mov.[wl]
-   insn with a 16bit absolute address.  */
-#define R_MOVL1        0x4c
-
-/* This reloc identifies mov.[wl] insns which formerly had
-   a 32/24bit absolute address and now have a 16bit absolute address.  */
-#define R_MOVL2        0x4d
-
-/* This reloc identifies a bCC:8 which will have it's condition
-   inverted and its target redirected to the target of the branch
-   in the following insn.  */
-#define R_BCC_INV      0x4e
-
-/* This reloc identifies a jmp instruction that has been deleted.  */
-#define R_JMP_DEL      0x4f
-
-/* Z8k modes */
-#define R_IMM16   0x01         /* 16 bit abs */
-#define R_JR     0x02          /* jr  8 bit disp */
-#define R_IMM4L   0x23         /* low nibble */
-#define R_IMM8    0x22         /* 8 bit abs */
-#define R_IMM32   R_RELLONG    /* 32 bit abs */
-#define R_CALL    R_DA         /* Absolute address which could be a callr */
-#define R_JP     R_DA          /* Absolute address which could be a jp */
-#define R_REL16   0x04         /* 16 bit PC rel */
-#define R_CALLR          0x05          /* callr 12 bit disp */
-#define R_SEG     0x10         /* set if in segmented mode */
-#define R_IMM4H   0x24         /* high nibble */
-#define R_DISP7   0x25          /* djnz displacement */
-
-/* Z80 modes */
-#define R_OFF8    0x32         /* 8 bit signed abs, for (i[xy]+d) */
-#define R_IMM24   0x33          /* 24 bit abs */
-#define R_IMM16BE 0x3A          /* 16 bit abs, big endian */
-/* R_JR, R_IMM8, R_IMM16, R_IMM32 - as for Z8k */
-#define R_BYTE0  0x34          /* first (lowest) 8 bits of multibyte value */
-#define R_BYTE1  0x35          /* second 8 bits of multibyte value */
-#define R_BYTE2  0x36          /* third 8 bits of multibyte value */
-#define R_BYTE3  0x37          /* fourth (highest) 8 bits of multibyte value */
-#define R_WORD0  0x38          /* lowest 16 bits of 32 or 24 bit value */
-#define R_WORD1  0x39          /* highest 16 bits of 32 or 24 bit value */
-
 #endif /* GNU_COFF_INTERNAL_H */
index fc246ee1787db640e41cc9802eb65662a081e495..5d242d12c247de9c4e3808fdf6f3a7d3767b9d80 100644 (file)
@@ -549,12 +549,20 @@ struct external_reloc
   do memset (dst->r_reserved, 0, sizeof (dst->r_reserved)); while (0)
 
 /* various relocation types.  */
-#define R_ABS     0x0000            /* no relocation */
-#define R_REL13   0x002A            /* 13-bit direct reference (???) */
-#define R_PARTLS7 0x0028            /* 7 LSBs of an address */
-#define R_PARTMS9 0x0029            /* 9MSBs of an address */
-#define R_EXTWORD 0x002B            /* 23-bit direct reference */
-#define R_EXTWORD16 0x002C          /* 16-bit direct reference to 23-bit addr*/
-#define R_EXTWORDMS7 0x002D         /* upper 7 bits of 23-bit address */
+#define R_REL24                 5
+#define R_RELWORD      16
+#define R_RELLONG      17
+#define R_PCRWORD      19
+#define R_PCR24                21
+#define R_PARTLS16     32
+#define R_PARTMS8      33
+
+#define R_ABS           0      /* no relocation */
+#define R_REL13       0x2A     /* 13-bit direct reference (???) */
+#define R_PARTLS7     0x28     /* 7 LSBs of an address */
+#define R_PARTMS9     0x29     /* 9MSBs of an address */
+#define R_EXTWORD     0x2B     /* 23-bit direct reference */
+#define R_EXTWORD16   0x2C     /* 16-bit direct reference to 23-bit addr*/
+#define R_EXTWORDMS7  0x2D     /* upper 7 bits of 23-bit address */
 
 #endif /* COFF_TI_H */
index 583b7df3ccda15aebd30b6de67c027e6094e0aa4..4d3e6e79177adb437fb9935008eb0b4d34e24a44 100644 (file)
@@ -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
index d929216effa55230612bc4e6d7352c8e3c39e175..1ba8e45fea242877cbf5be0f090a7678b2ea482d 100644 (file)
@@ -58,3 +58,19 @@ struct external_reloc
 
 #define RELOC struct external_reloc
 #define RELSZ 16
+
+/* Z80 relocations.  */
+#define R_IMM16   0x01         /* 16 bit abs */
+#define R_JR      0x02         /* jr  8 bit disp */
+#define R_IMM32   0x11         /* 32 bit abs */
+#define R_IMM8    0x22         /* 8 bit abs */
+
+#define R_OFF8    0x32         /* 8 bit signed abs, for (i[xy]+d) */
+#define R_IMM24   0x33         /* 24 bit abs */
+#define R_IMM16BE 0x3A         /* 16 bit abs, big endian */
+#define R_BYTE0   0x34         /* first (lowest) 8 bits of multibyte value */
+#define R_BYTE1   0x35         /* second 8 bits of multibyte value */
+#define R_BYTE2   0x36         /* third 8 bits of multibyte value */
+#define R_BYTE3   0x37         /* fourth (highest) 8 bits of multibyte value */
+#define R_WORD0   0x38         /* lowest 16 bits of 32 or 24 bit value */
+#define R_WORD1   0x39         /* highest 16 bits of 32 or 24 bit value */
index c1da61cfbccb400f719c999b759bf683ccdb1bd2..90ac466e4d012cc9b3dfadc839bf673f166e9181 100644 (file)
@@ -47,3 +47,14 @@ struct external_reloc
 #define RELOC struct external_reloc
 #define RELSZ 16
 
+/* Z8k relocations.  */
+#define R_IMM16   0x01         /* 16 bit abs */
+#define R_JR      0x02         /* jr  8 bit disp */
+#define R_IMM32   0x11         /* 32 bit abs */
+#define R_IMM8    0x22         /* 8 bit abs */
+#define R_IMM4L   0x23         /* low nibble */
+#define R_REL16   0x04         /* 16 bit PC rel */
+#define R_CALLR   0x05         /* callr 12 bit disp */
+#define R_SEG     0x10         /* set if in segmented mode */
+#define R_IMM4H   0x24         /* high nibble */
+#define R_DISP7   0x25         /* djnz displacement */