llvm.org GIT mirror llvm / 07192e9
[ARC] Prepare the implementation of relocation for LLD Reviewers: ruiu, kparzysz, petecoup, rafael Reviewed By: kparzysz Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37556 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313109 91177308-0d34-0410-b5e6-96231b3b80d8 Leslie Zhai 2 years ago
5 changed file(s) with 107 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
429429 #include "ELFRelocs/ARM.def"
430430 };
431431
432 // ARC Specific e_flags
433 enum : unsigned {
434 EF_ARC_MACH_MSK = 0x000000ff,
435 EF_ARC_OSABI_MSK = 0x00000f00,
436 E_ARC_MACH_ARC600 = 0x00000002,
437 E_ARC_MACH_ARC601 = 0x00000004,
438 E_ARC_MACH_ARC700 = 0x00000003,
439 EF_ARC_CPU_ARCV2EM = 0x00000005,
440 EF_ARC_CPU_ARCV2HS = 0x00000006,
441 E_ARC_OSABI_ORIG = 0x00000000,
442 E_ARC_OSABI_V2 = 0x00000200,
443 E_ARC_OSABI_V3 = 0x00000300,
444 E_ARC_OSABI_V4 = 0x00000400,
445 EF_ARC_PIC = 0x00000100
446 };
447
448 // ELF Relocation types for ARC
449 enum {
450 #include "ELFRelocs/ARC.def"
451 };
452
432453 // AVR specific e_flags
433454 enum : unsigned {
434455 EF_AVR_ARCH_AVR1 = 1,
0
1 #ifndef ELF_RELOC
2 #error "ELF_RELOC must be defined"
3 #endif
4
5 ELF_RELOC(R_ARC_NONE, 0)
6 ELF_RELOC(R_ARC_8, 1)
7 ELF_RELOC(R_ARC_16, 2)
8 ELF_RELOC(R_ARC_24, 3)
9 ELF_RELOC(R_ARC_32, 4)
10 ELF_RELOC(R_ARC_N8, 8)
11 ELF_RELOC(R_ARC_N16, 9)
12 ELF_RELOC(R_ARC_N24, 10)
13 ELF_RELOC(R_ARC_N32, 11)
14 ELF_RELOC(R_ARC_SDA, 12)
15 ELF_RELOC(R_ARC_SECTOFF, 13)
16 ELF_RELOC(R_ARC_S21H_PCREL, 14)
17 ELF_RELOC(R_ARC_S21W_PCREL, 15)
18 ELF_RELOC(R_ARC_S25H_PCREL, 16)
19 ELF_RELOC(R_ARC_S25W_PCREL, 17)
20 ELF_RELOC(R_ARC_SDA32, 18)
21 ELF_RELOC(R_ARC_SDA_LDST, 19)
22 ELF_RELOC(R_ARC_SDA_LDST1, 20)
23 ELF_RELOC(R_ARC_SDA_LDST2, 21)
24 ELF_RELOC(R_ARC_SDA16_LD, 22)
25 ELF_RELOC(R_ARC_SDA16_LD1, 23)
26 ELF_RELOC(R_ARC_SDA16_LD2, 24)
27 ELF_RELOC(R_ARC_S13_PCREL, 25)
28 ELF_RELOC(R_ARC_W, 26)
29 ELF_RELOC(R_ARC_32_ME, 27)
30 ELF_RELOC(R_ARC_32_ME_S, 105)
31 ELF_RELOC(R_ARC_N32_ME, 28)
32 ELF_RELOC(R_ARC_SECTOFF_ME, 29)
33 ELF_RELOC(R_ARC_SDA32_ME, 30)
34 ELF_RELOC(R_ARC_W_ME, 31)
35 ELF_RELOC(R_AC_SECTOFF_U8, 35)
36 ELF_RELOC(R_AC_SECTOFF_U8_1, 36)
37 ELF_RELOC(R_AC_SECTOFF_U8_2, 37)
38 ELF_RELOC(R_AC_SECTOFF_S9, 38)
39 ELF_RELOC(R_AC_SECTOFF_S9_1, 39)
40 ELF_RELOC(R_AC_SECTOFF_S9_2, 40)
41 ELF_RELOC(R_ARC_SECTOFF_ME_1, 41)
42 ELF_RELOC(R_ARC_SECTOFF_ME_2, 42)
43 ELF_RELOC(R_ARC_SECTOFF_1, 43)
44 ELF_RELOC(R_ARC_SECTOFF_2, 44)
45 ELF_RELOC(R_ARC_SDA_12, 45)
46 ELF_RELOC(R_ARC_SDA16_ST2, 48)
47 ELF_RELOC(R_ARC_32_PCREL, 49)
48 ELF_RELOC(R_ARC_PC32, 50)
49 ELF_RELOC(R_ARC_GOT32, 59)
50 ELF_RELOC(R_ARC_GOTPC32, 51)
51 ELF_RELOC(R_ARC_PLT32, 52)
52 ELF_RELOC(R_ARC_COPY, 53)
53 ELF_RELOC(R_ARC_GLOB_DAT, 54)
54 ELF_RELOC(R_ARC_JMP_SLOT, 55)
55 ELF_RELOC(R_ARC_RELATIVE, 56)
56 ELF_RELOC(R_ARC_GOTOFF, 57)
57 ELF_RELOC(R_ARC_GOTPC, 58)
58 ELF_RELOC(R_ARC_S21W_PCREL_PLT, 60)
59 ELF_RELOC(R_ARC_S25H_PCREL_PLT, 61)
60 ELF_RELOC(R_ARC_JLI_SECTOFF, 63)
61 ELF_RELOC(R_ARC_TLS_DTPMOD, 66)
62 ELF_RELOC(R_ARC_TLS_TPOFF, 68)
63 ELF_RELOC(R_ARC_TLS_GD_GOT, 69)
64 ELF_RELOC(R_ARC_TLS_GD_LD, 70)
65 ELF_RELOC(R_ARC_TLS_GD_CALL, 71)
66 ELF_RELOC(R_ARC_TLS_IE_GOT, 72)
67 ELF_RELOC(R_ARC_TLS_DTPOFF, 67)
68 ELF_RELOC(R_ARC_TLS_DTPOFF_S9, 73)
69 ELF_RELOC(R_ARC_TLS_LE_S9, 74)
70 ELF_RELOC(R_ARC_TLS_LE_32, 75)
71 ELF_RELOC(R_ARC_S25W_PCREL_PLT, 76)
72 ELF_RELOC(R_ARC_S21H_PCREL_PLT, 77)
73 ELF_RELOC(R_ARC_NPS_CMEM16, 78)
4848 textual header "BinaryFormat/ELFRelocs/AArch64.def"
4949 textual header "BinaryFormat/ELFRelocs/AMDGPU.def"
5050 textual header "BinaryFormat/ELFRelocs/ARM.def"
51 textual header "BinaryFormat/ELFRelocs/ARC.def"
5152 textual header "BinaryFormat/ELFRelocs/AVR.def"
5253 textual header "BinaryFormat/ELFRelocs/BPF.def"
5354 textual header "BinaryFormat/ELFRelocs/Hexagon.def"
5353 case ELF::EM_ARM:
5454 switch (Type) {
5555 #include "llvm/BinaryFormat/ELFRelocs/ARM.def"
56 default:
57 break;
58 }
59 break;
60 case ELF::EM_ARC_COMPACT:
61 case ELF::EM_ARC_COMPACT2:
62 switch (Type) {
63 #include "llvm/BinaryFormat/ELFRelocs/ARC.def"
5664 default:
5765 break;
5866 }
576576 case ELF::EM_ARM:
577577 #include "llvm/BinaryFormat/ELFRelocs/ARM.def"
578578 break;
579 case ELF::EM_ARC:
580 #include "llvm/BinaryFormat/ELFRelocs/ARC.def"
581 break;
579582 case ELF::EM_RISCV:
580583 #include "llvm/BinaryFormat/ELFRelocs/RISCV.def"
581584 break;