Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 1 | #ifndef ELF_RELOC |
2 | #error "ELF_RELOC must be defined" |
||
3 | #endif |
||
4 | |||
5 | // These types and values are from the LoongArch ELF psABI which can be found at |
||
6 | // https://github.com/loongson/LoongArch-Documentation |
||
7 | // and these definitions has been adopted by binutils (include/elf/loongarch.h). |
||
8 | // The commit hash (main branch) we reference is: |
||
9 | // 9b3bd9f4a497115913c22f1a2a47863798fbc02a |
||
10 | |||
11 | ELF_RELOC(R_LARCH_NONE, 0) |
||
12 | ELF_RELOC(R_LARCH_32, 1) |
||
13 | ELF_RELOC(R_LARCH_64, 2) |
||
14 | ELF_RELOC(R_LARCH_RELATIVE, 3) |
||
15 | ELF_RELOC(R_LARCH_COPY, 4) |
||
16 | ELF_RELOC(R_LARCH_JUMP_SLOT, 5) |
||
17 | ELF_RELOC(R_LARCH_TLS_DTPMOD32, 6) |
||
18 | ELF_RELOC(R_LARCH_TLS_DTPMOD64, 7) |
||
19 | ELF_RELOC(R_LARCH_TLS_DTPREL32, 8) |
||
20 | ELF_RELOC(R_LARCH_TLS_DTPREL64, 9) |
||
21 | ELF_RELOC(R_LARCH_TLS_TPREL32, 10) |
||
22 | ELF_RELOC(R_LARCH_TLS_TPREL64, 11) |
||
23 | ELF_RELOC(R_LARCH_IRELATIVE, 12) |
||
24 | ELF_RELOC(R_LARCH_MARK_LA, 20) |
||
25 | ELF_RELOC(R_LARCH_MARK_PCREL, 21) |
||
26 | ELF_RELOC(R_LARCH_SOP_PUSH_PCREL, 22) |
||
27 | ELF_RELOC(R_LARCH_SOP_PUSH_ABSOLUTE, 23) |
||
28 | ELF_RELOC(R_LARCH_SOP_PUSH_DUP, 24) |
||
29 | ELF_RELOC(R_LARCH_SOP_PUSH_GPREL, 25) |
||
30 | ELF_RELOC(R_LARCH_SOP_PUSH_TLS_TPREL, 26) |
||
31 | ELF_RELOC(R_LARCH_SOP_PUSH_TLS_GOT, 27) |
||
32 | ELF_RELOC(R_LARCH_SOP_PUSH_TLS_GD, 28) |
||
33 | ELF_RELOC(R_LARCH_SOP_PUSH_PLT_PCREL, 29) |
||
34 | ELF_RELOC(R_LARCH_SOP_ASSERT, 30) |
||
35 | ELF_RELOC(R_LARCH_SOP_NOT, 31) |
||
36 | ELF_RELOC(R_LARCH_SOP_SUB, 32) |
||
37 | ELF_RELOC(R_LARCH_SOP_SL, 33) |
||
38 | ELF_RELOC(R_LARCH_SOP_SR, 34) |
||
39 | ELF_RELOC(R_LARCH_SOP_ADD, 35) |
||
40 | ELF_RELOC(R_LARCH_SOP_AND, 36) |
||
41 | ELF_RELOC(R_LARCH_SOP_IF_ELSE, 37) |
||
42 | ELF_RELOC(R_LARCH_SOP_POP_32_S_10_5, 38) |
||
43 | ELF_RELOC(R_LARCH_SOP_POP_32_U_10_12, 39) |
||
44 | ELF_RELOC(R_LARCH_SOP_POP_32_S_10_12, 40) |
||
45 | ELF_RELOC(R_LARCH_SOP_POP_32_S_10_16, 41) |
||
46 | ELF_RELOC(R_LARCH_SOP_POP_32_S_10_16_S2, 42) |
||
47 | ELF_RELOC(R_LARCH_SOP_POP_32_S_5_20, 43) |
||
48 | ELF_RELOC(R_LARCH_SOP_POP_32_S_0_5_10_16_S2, 44) |
||
49 | ELF_RELOC(R_LARCH_SOP_POP_32_S_0_10_10_16_S2, 45) |
||
50 | ELF_RELOC(R_LARCH_SOP_POP_32_U, 46) |
||
51 | ELF_RELOC(R_LARCH_ADD8, 47) |
||
52 | ELF_RELOC(R_LARCH_ADD16, 48) |
||
53 | ELF_RELOC(R_LARCH_ADD24, 49) |
||
54 | ELF_RELOC(R_LARCH_ADD32, 50) |
||
55 | ELF_RELOC(R_LARCH_ADD64, 51) |
||
56 | ELF_RELOC(R_LARCH_SUB8, 52) |
||
57 | ELF_RELOC(R_LARCH_SUB16, 53) |
||
58 | ELF_RELOC(R_LARCH_SUB24, 54) |
||
59 | ELF_RELOC(R_LARCH_SUB32, 55) |
||
60 | ELF_RELOC(R_LARCH_SUB64, 56) |
||
61 | ELF_RELOC(R_LARCH_GNU_VTINHERIT, 57) |
||
62 | ELF_RELOC(R_LARCH_GNU_VTENTRY, 58) |
||
63 | |||
64 | // Relocs whose processing do not require a stack machine. |
||
65 | // |
||
66 | // Spec addition: https://github.com/loongson/LoongArch-Documentation/pull/57 |
||
67 | // Binutils commit 6d13722a97cee3fd397e116bde3bcedbb1e220be |
||
68 | // and commit 9801120721c3a702ce3bd50433ef920f92a83502 |
||
69 | ELF_RELOC(R_LARCH_B16, 64) |
||
70 | ELF_RELOC(R_LARCH_B21, 65) |
||
71 | ELF_RELOC(R_LARCH_B26, 66) |
||
72 | ELF_RELOC(R_LARCH_ABS_HI20, 67) |
||
73 | ELF_RELOC(R_LARCH_ABS_LO12, 68) |
||
74 | ELF_RELOC(R_LARCH_ABS64_LO20, 69) |
||
75 | ELF_RELOC(R_LARCH_ABS64_HI12, 70) |
||
76 | ELF_RELOC(R_LARCH_PCALA_HI20, 71) |
||
77 | ELF_RELOC(R_LARCH_PCALA_LO12, 72) |
||
78 | ELF_RELOC(R_LARCH_PCALA64_LO20, 73) |
||
79 | ELF_RELOC(R_LARCH_PCALA64_HI12, 74) |
||
80 | ELF_RELOC(R_LARCH_GOT_PC_HI20, 75) |
||
81 | ELF_RELOC(R_LARCH_GOT_PC_LO12, 76) |
||
82 | ELF_RELOC(R_LARCH_GOT64_PC_LO20, 77) |
||
83 | ELF_RELOC(R_LARCH_GOT64_PC_HI12, 78) |
||
84 | ELF_RELOC(R_LARCH_GOT_HI20, 79) |
||
85 | ELF_RELOC(R_LARCH_GOT_LO12, 80) |
||
86 | ELF_RELOC(R_LARCH_GOT64_LO20, 81) |
||
87 | ELF_RELOC(R_LARCH_GOT64_HI12, 82) |
||
88 | ELF_RELOC(R_LARCH_TLS_LE_HI20, 83) |
||
89 | ELF_RELOC(R_LARCH_TLS_LE_LO12, 84) |
||
90 | ELF_RELOC(R_LARCH_TLS_LE64_LO20, 85) |
||
91 | ELF_RELOC(R_LARCH_TLS_LE64_HI12, 86) |
||
92 | ELF_RELOC(R_LARCH_TLS_IE_PC_HI20, 87) |
||
93 | ELF_RELOC(R_LARCH_TLS_IE_PC_LO12, 88) |
||
94 | ELF_RELOC(R_LARCH_TLS_IE64_PC_LO20, 89) |
||
95 | ELF_RELOC(R_LARCH_TLS_IE64_PC_HI12, 90) |
||
96 | ELF_RELOC(R_LARCH_TLS_IE_HI20, 91) |
||
97 | ELF_RELOC(R_LARCH_TLS_IE_LO12, 92) |
||
98 | ELF_RELOC(R_LARCH_TLS_IE64_LO20, 93) |
||
99 | ELF_RELOC(R_LARCH_TLS_IE64_HI12, 94) |
||
100 | ELF_RELOC(R_LARCH_TLS_LD_PC_HI20, 95) |
||
101 | ELF_RELOC(R_LARCH_TLS_LD_HI20, 96) |
||
102 | ELF_RELOC(R_LARCH_TLS_GD_PC_HI20, 97) |
||
103 | ELF_RELOC(R_LARCH_TLS_GD_HI20, 98) |
||
104 | ELF_RELOC(R_LARCH_32_PCREL, 99) |
||
105 | ELF_RELOC(R_LARCH_RELAX, 100) |