summaryrefslogtreecommitdiffstats
path: root/third_party/rust/goblin/src/elf/constants_relocation.rs
blob: 6339de5434d6b85b43fab314ff16ac0d38a1a57c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
// x86_64 relocations
/// No reloc.
pub const R_X86_64_NONE: u32 = 0;
/// Direct 64 bit.
pub const R_X86_64_64: u32 = 1;
/// PC relative 32 bit signed.
pub const R_X86_64_PC32: u32 = 2;
/// 32 bit GOT entry.
pub const R_X86_64_GOT32: u32 = 3;
/// 32 bit PLT address.
pub const R_X86_64_PLT32: u32 = 4;
/// Copy symbol at runtime.
pub const R_X86_64_COPY: u32 = 5;
/// Create GOT entry.
pub const R_X86_64_GLOB_DAT: u32 = 6;
/// Create PLT entry.
pub const R_X86_64_JUMP_SLOT: u32 = 7;
/// Adjust by program base.
pub const R_X86_64_RELATIVE: u32 = 8;
/// 32 bit signed PC relative offset to GOT.
pub const R_X86_64_GOTPCREL: u32 = 9;
/// Direct 32 bit zero extended.
pub const R_X86_64_32: u32 = 10;
/// Direct 32 bit sign extended.
pub const R_X86_64_32S: u32 = 11;
/// Direct 16 bit zero extended.
pub const R_X86_64_16: u32 = 12;
/// 16 bit sign extended pc relative.
pub const R_X86_64_PC16: u32 = 13;
/// Direct 8 bit sign extended.
pub const R_X86_64_8: u32 = 14;
/// 8 bit sign extended pc relative.
pub const R_X86_64_PC8: u32 = 15;
/// ID of module containing symbol.
pub const R_X86_64_DTPMOD64: u32 = 16;
/// Offset in module's TLS block.
pub const R_X86_64_DTPOFF64: u32 = 17;
/// Offset in initial TLS block.
pub const R_X86_64_TPOFF64: u32 = 18;
/// 32 bit signed PC relative offset to two GOT entries for GD symbol.
pub const R_X86_64_TLSGD: u32 = 19;
/// 32 bit signed PC relative offset to two GOT entries for LD symbol.
pub const R_X86_64_TLSLD: u32 = 20;
/// Offset in TLS block.
pub const R_X86_64_DTPOFF32: u32 = 21;
/// 32 bit signed PC relative offset to GOT entry for IE symbol.
pub const R_X86_64_GOTTPOFF: u32 = 22;
/// Offset in initial TLS block.
pub const R_X86_64_TPOFF32: u32 = 23;
/// PC relative 64 bit.
pub const R_X86_64_PC64: u32 = 24;
/// 64 bit offset to GOT.
pub const R_X86_64_GOTOFF64: u32 = 25;
/// 32 bit signed pc relative offset to GOT.
pub const R_X86_64_GOTPC32: u32 = 26;
/// 64-bit GOT entry offset.
pub const R_X86_64_GOT64: u32 = 27;
/// 64-bit PC relative offset to GOT entry.
pub const R_X86_64_GOTPCREL64: u32 = 28;
/// 64-bit PC relative offset to GOT.
pub const R_X86_64_GOTPC64: u32 = 29;
/// like GOT64, says PLT entry needed.
pub const R_X86_64_GOTPLT64: u32 = 30;
/// 64-bit GOT relative offset to PLT entry.
pub const R_X86_64_PLTOFF64: u32 = 31;
/// Size of symbol plus 32-bit addend.
pub const R_X86_64_SIZE32: u32 = 32;
/// Size of symbol plus 64-bit addend.
pub const R_X86_64_SIZE64: u32 = 33;
/// GOT offset for TLS descriptor..
pub const R_X86_64_GOTPC32_TLSDESC: u32 = 34;
/// Marker for call through TLS descriptor..
pub const R_X86_64_TLSDESC_CALL: u32 = 35;
/// TLS descriptor..
pub const R_X86_64_TLSDESC: u32 = 36;
/// Adjust indirectly by program base.
pub const R_X86_64_IRELATIVE: u32 = 37;
/// 64-bit adjust by program base.
pub const R_X86_64_RELATIVE64: u32 = 38;
///Load from 32 bit signed pc relative offset to GOT entry without REX prefix, relaxable.
pub const R_X86_64_GOTPCRELX: u32 = 41;
/// Load from 32 bit signed pc relative offset to GOT entry with REX prefix, relaxable.
pub const R_X86_64_REX_GOTPCRELX: u32 = 42;
pub const R_X86_64_NUM: u32 = 43;

// Intel 80386 specific definitions

// i386 relocs
/// No reloc
pub const R_386_NONE: u32 = 0;
/// Direct 32 bit
pub const R_386_32: u32 = 1;
/// PC relative 32 bit
pub const R_386_PC32: u32 = 2;
/// 32 bit GOT entry
pub const R_386_GOT32: u32 = 3;
/// 32 bit PLT address
pub const R_386_PLT32: u32 = 4;
/// Copy symbol at runtime
pub const R_386_COPY: u32 = 5;
/// Create GOT entry
pub const R_386_GLOB_DAT: u32 = 6;
/// Create PLT entry
pub const R_386_JMP_SLOT: u32 = 7;
/// Adjust by program base
pub const R_386_RELATIVE: u32 = 8;
/// 32 bit offset to GOT
pub const R_386_GOTOFF: u32 = 9;
/// 32 bit PC relative offset to GOT
pub const R_386_GOTPC: u32 = 10;
pub const R_386_32PLT: u32 = 11;
/// Offset in static TLS block
pub const R_386_TLS_TPOFF: u32 = 14;
/// Address of GOT entry for static TLS block offset
pub const R_386_TLS_IE: u32 = 15;
/// GOT entry for static TLS block offset
pub const R_386_TLS_GOTIE: u32 = 16;
/// Offset relative to static TLS block
pub const R_386_TLS_LE: u32 = 17;
/// Direct 32 bit for GNU version of general dynamic thread local data
pub const R_386_TLS_GD: u32 = 18;
/// Direct 32 bit for GNU version of local dynamic thread local data in LE code
pub const R_386_TLS_LDM: u32 = 19;
pub const R_386_16: u32 = 20;
pub const R_386_PC16: u32 = 21;
pub const R_386_8: u32 = 22;
pub const R_386_PC8: u32 = 23;
/// Direct 32 bit for general dynamic thread local data
pub const R_386_TLS_GD_32: u32 = 24;
/// Tag for pushl in GD TLS code
pub const R_386_TLS_GD_PUSH: u32 = 25;
/// Relocation for call to __tls_get_addr()
pub const R_386_TLS_GD_CALL: u32 = 26;
/// Tag for popl in GD TLS code
pub const R_386_TLS_GD_POP: u32 = 27;
/// Direct 32 bit for local dynamic thread local data in LE code
pub const R_386_TLS_LDM_32: u32 = 28;
/// Tag for pushl in LDM TLS code
pub const R_386_TLS_LDM_PUSH: u32 = 29;
/// Relocation for call to __tls_get_addr() in LDM code
pub const R_386_TLS_LDM_CALL: u32 = 30;
/// Tag for popl in LDM TLS code
pub const R_386_TLS_LDM_POP: u32 = 31;
/// Offset relative to TLS block
pub const R_386_TLS_LDO_32: u32 = 32;
/// GOT entry for negated static TLS block offset
pub const R_386_TLS_IE_32: u32 = 33;
/// Negated offset relative to static TLS block
pub const R_386_TLS_LE_32: u32 = 34;
/// ID of module containing symbol
pub const R_386_TLS_DTPMOD32: u32 = 35;
/// Offset in TLS block
pub const R_386_TLS_DTPOFF32: u32 = 36;
/// Negated offset in static TLS block
pub const R_386_TLS_TPOFF32: u32 = 37;
/// 32-bit symbol size
pub const R_386_SIZE32: u32 = 38;
/// GOT offset for TLS descriptor.
pub const R_386_TLS_GOTDESC: u32 = 39;
/// Marker of call through TLS descriptor for relaxation
pub const R_386_TLS_DESC_CALL: u32 = 40;
/// TLS descriptor containing pointer to code and to argument, returning the TLS offset for the symbol
pub const R_386_TLS_DESC: u32 = 41;
/// Adjust indirectly by program base
pub const R_386_IRELATIVE: u32 = 42;
/// Load from 32 bit GOT entry, relaxable
pub const R_386_GOT32X: u32 = 43;
/// Keep this the last entry
pub const R_386_NUM: u32 = 44;

// AArch64 relocs
/// No relocation
pub const R_AARCH64_NONE: u32 = 0;

// ILP32 AArch64 relocs
/// Direct 32 bit
pub const R_AARCH64_P32_ABS32: u32 = 1;
/// Copy symbol at runtime
pub const R_AARCH64_P32_COPY: u32 = 180;
/// Create GOT entry
pub const R_AARCH64_P32_GLOB_DAT: u32 = 181;
/// Create PLT entry
pub const R_AARCH64_P32_JUMP_SLOT: u32 = 182;
/// Adjust by program base
pub const R_AARCH64_P32_RELATIVE: u32 = 183;
/// Module number, 32 bit
pub const R_AARCH64_P32_TLS_DTPMOD: u32 = 184;
/// Module-relative offset, 32 bit
pub const R_AARCH64_P32_TLS_DTPREL: u32 = 185;
/// TP-relative offset, 32 bit
pub const R_AARCH64_P32_TLS_TPREL: u32 = 186;
/// TLS Descriptor
pub const R_AARCH64_P32_TLSDESC: u32 = 187;
/// STT_GNU_IFUNC relocation
pub const R_AARCH64_P32_IRELATIVE: u32 = 188;

// LP64 AArch64 relocs
/// Direct 64 bit
pub const R_AARCH64_ABS64: u32 = 257;
/// Direct 32 bit
pub const R_AARCH64_ABS32: u32 = 258;
/// Direct 16-bit
pub const R_AARCH64_ABS16: u32 = 259;
/// PC-relative 64-bit
pub const R_AARCH64_PREL64: u32 = 260;
/// PC-relative 32-bit
pub const R_AARCH64_PREL32: u32 = 261;
/// PC-relative 16-bit
pub const R_AARCH64_PREL16: u32 = 262;
/// Dir. MOVZ imm. from bits 15:0
pub const R_AARCH64_MOVW_UABS_G0: u32 = 263;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_UABS_G0_NC: u32 = 264;
/// Dir. MOVZ imm. from bits 31:16
pub const R_AARCH64_MOVW_UABS_G1: u32 = 265;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_UABS_G1_NC: u32 = 266;
/// Dir. MOVZ imm. from bits 47:32
pub const R_AARCH64_MOVW_UABS_G2: u32 = 267;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_UABS_G2_NC: u32 = 268;
/// Dir. MOV{K,Z} imm. from 63:48
pub const R_AARCH64_MOVW_UABS_G3: u32 = 269;
/// Dir. MOV{N,Z} imm. from 15:0
pub const R_AARCH64_MOVW_SABS_G0: u32 = 270;
/// Dir. MOV{N,Z} imm. from 31:16
pub const R_AARCH64_MOVW_SABS_G1: u32 = 271;
/// Dir. MOV{N,Z} imm. from 47:32
pub const R_AARCH64_MOVW_SABS_G2: u32 = 272;
/// PC-rel. LD imm. from bits 20:2
pub const R_AARCH64_LD_PREL_LO19: u32 = 273;
/// PC-rel. ADR imm. from bits 20:0
pub const R_AARCH64_ADR_PREL_LO21: u32 = 274;
/// Page-rel. ADRP imm. from 32:12
pub const R_AARCH64_ADR_PREL_PG_HI21: u32 = 275;
/// Likewise; no overflow check
pub const R_AARCH64_ADR_PREL_PG_HI21_NC: u32 = 276;
/// Dir. ADD imm. from bits 11:0
pub const R_AARCH64_ADD_ABS_LO12_NC: u32 = 277;
/// Likewise for LD/ST; no check.
pub const R_AARCH64_LDST8_ABS_LO12_NC: u32 = 278;
/// PC-rel. TBZ/TBNZ imm. from 15:2
pub const R_AARCH64_TSTBR14: u32 = 279;
/// PC-rel. cond. br. imm. from 20:2.
pub const R_AARCH64_CONDBR19: u32 = 280;
/// PC-rel. B imm. from bits 27:2
pub const R_AARCH64_JUMP26: u32 = 282;
/// Likewise for CALL
pub const R_AARCH64_CALL26: u32 = 283;
/// Dir. ADD imm. from bits 11:1
pub const R_AARCH64_LDST16_ABS_LO12_NC: u32 = 284;
/// Likewise for bits 11:2
pub const R_AARCH64_LDST32_ABS_LO12_NC: u32 = 285;
/// Likewise for bits 11:3
pub const R_AARCH64_LDST64_ABS_LO12_NC: u32 = 286;
/// PC-rel. MOV{N,Z} imm. from 15:0
pub const R_AARCH64_MOVW_PREL_G0: u32 = 287;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_PREL_G0_NC: u32 = 288;
/// PC-rel. MOV{N,Z} imm. from 31:16.
pub const R_AARCH64_MOVW_PREL_G1: u32 = 289;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_PREL_G1_NC: u32 = 290;
/// PC-rel. MOV{N,Z} imm. from 47:32.
pub const R_AARCH64_MOVW_PREL_G2: u32 = 291;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_PREL_G2_NC: u32 = 292;
/// PC-rel. MOV{N,Z} imm. from 63:48.
pub const R_AARCH64_MOVW_PREL_G3: u32 = 293;
/// Dir. ADD imm. from bits 11:4
pub const R_AARCH64_LDST128_ABS_LO12_NC: u32 = 299;
/// GOT-rel. off. MOV{N,Z} imm. 15:0.
pub const R_AARCH64_MOVW_GOTOFF_G0: u32 = 300;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_GOTOFF_G0_NC: u32 = 301;
/// GOT-rel. o. MOV{N,Z} imm. 31:16
pub const R_AARCH64_MOVW_GOTOFF_G1: u32 = 302;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_GOTOFF_G1_NC: u32 = 303;
/// GOT-rel. o. MOV{N,Z} imm. 47:32
pub const R_AARCH64_MOVW_GOTOFF_G2: u32 = 304;
/// Likewise for MOVK; no check
pub const R_AARCH64_MOVW_GOTOFF_G2_NC: u32 = 305;
/// GOT-rel. o. MOV{N,Z} imm. 63:48
pub const R_AARCH64_MOVW_GOTOFF_G3: u32 = 306;
/// GOT-relative 64-bit
pub const R_AARCH64_GOTREL64: u32 = 307;
/// GOT-relative 32-bit
pub const R_AARCH64_GOTREL32: u32 = 308;
/// PC-rel. GOT off. load imm. 20:2
pub const R_AARCH64_GOT_LD_PREL19: u32 = 309;
/// GOT-rel. off. LD/ST imm. 14:3
pub const R_AARCH64_LD64_GOTOFF_LO15: u32 = 310;
/// P-page-rel. GOT off. ADRP 32:12
pub const R_AARCH64_ADR_GOT_PAGE: u32 = 311;
/// Dir. GOT off. LD/ST imm. 11:3
pub const R_AARCH64_LD64_GOT_LO12_NC: u32 = 312;
/// GOT-page-rel. GOT off. LD/ST 14:3
pub const R_AARCH64_LD64_GOTPAGE_LO15: u32 = 313;
/// PC-relative ADR imm. 20:0
pub const R_AARCH64_TLSGD_ADR_PREL21: u32 = 512;
/// page-rel. ADRP imm. 32:12
pub const R_AARCH64_TLSGD_ADR_PAGE21: u32 = 513;
/// direct ADD imm. from 11:0
pub const R_AARCH64_TLSGD_ADD_LO12_NC: u32 = 514;
/// GOT-rel. MOV{N,Z} 31:16
pub const R_AARCH64_TLSGD_MOVW_G1: u32 = 515;
/// GOT-rel. MOVK imm. 15:0
pub const R_AARCH64_TLSGD_MOVW_G0_NC: u32 = 516;
/// Like 512; local dynamic model
pub const R_AARCH64_TLSLD_ADR_PREL21: u32 = 517;
/// Like 513; local dynamic model
pub const R_AARCH64_TLSLD_ADR_PAGE21: u32 = 518;
/// Like 514; local dynamic model
pub const R_AARCH64_TLSLD_ADD_LO12_NC: u32 = 519;
/// Like 515; local dynamic model
pub const R_AARCH64_TLSLD_MOVW_G1: u32 = 520;
/// Like 516; local dynamic model
pub const R_AARCH64_TLSLD_MOVW_G0_NC: u32 = 521;
/// TLS PC-rel. load imm. 20:2
pub const R_AARCH64_TLSLD_LD_PREL19: u32 = 522;
/// TLS DTP-rel. MOV{N,Z} 47:32
pub const R_AARCH64_TLSLD_MOVW_DTPREL_G2: u32 = 523;
/// TLS DTP-rel. MOV{N,Z} 31:16
pub const R_AARCH64_TLSLD_MOVW_DTPREL_G1: u32 = 524;
/// Likewise; MOVK; no check
pub const R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC: u32 = 525;
/// TLS DTP-rel. MOV{N,Z} 15:0
pub const R_AARCH64_TLSLD_MOVW_DTPREL_G0: u32 = 526;
/// Likewise; MOVK; no check
pub const R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC: u32 = 527;
/// DTP-rel. ADD imm. from 23:12.
pub const R_AARCH64_TLSLD_ADD_DTPREL_HI12: u32 = 528;
/// DTP-rel. ADD imm. from 11:0
pub const R_AARCH64_TLSLD_ADD_DTPREL_LO12: u32 = 529;
/// Likewise; no ovfl. check
pub const R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC: u32 = 530;
/// DTP-rel. LD/ST imm. 11:0
pub const R_AARCH64_TLSLD_LDST8_DTPREL_LO12: u32 = 531;
/// Likewise; no check
pub const R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC: u32 = 532;
/// DTP-rel. LD/ST imm. 11:1
pub const R_AARCH64_TLSLD_LDST16_DTPREL_LO12: u32 = 533;
/// Likewise; no check
pub const R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC: u32 = 534;
/// DTP-rel. LD/ST imm. 11:2
pub const R_AARCH64_TLSLD_LDST32_DTPREL_LO12: u32 = 535;
/// Likewise; no check
pub const R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC: u32 = 536;
/// DTP-rel. LD/ST imm. 11:3
pub const R_AARCH64_TLSLD_LDST64_DTPREL_LO12: u32 = 537;
/// Likewise; no check
pub const R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC: u32 = 538;
/// GOT-rel. MOV{N,Z} 31:16
pub const R_AARCH64_TLSIE_MOVW_GOTTPREL_G1: u32 = 539;
/// GOT-rel. MOVK 15:0
pub const R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: u32 = 540;
/// Page-rel. ADRP 32:12
pub const R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21: u32 = 541;
/// Direct LD off. 11:3
pub const R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: u32 = 542;
/// PC-rel. load imm. 20:2
pub const R_AARCH64_TLSIE_LD_GOTTPREL_PREL19: u32 = 543;
/// TLS TP-rel. MOV{N,Z} 47:32
pub const R_AARCH64_TLSLE_MOVW_TPREL_G2: u32 = 544;
/// TLS TP-rel. MOV{N,Z} 31:16
pub const R_AARCH64_TLSLE_MOVW_TPREL_G1: u32 = 545;
/// Likewise; MOVK; no check
pub const R_AARCH64_TLSLE_MOVW_TPREL_G1_NC: u32 = 546;
/// TLS TP-rel. MOV{N,Z} 15:0
pub const R_AARCH64_TLSLE_MOVW_TPREL_G0: u32 = 547;
/// Likewise; MOVK; no check
pub const R_AARCH64_TLSLE_MOVW_TPREL_G0_NC: u32 = 548;
/// TP-rel. ADD imm. 23:12
pub const R_AARCH64_TLSLE_ADD_TPREL_HI12: u32 = 549;
/// TP-rel. ADD imm. 11:0
pub const R_AARCH64_TLSLE_ADD_TPREL_LO12: u32 = 550;
/// Likewise; no ovfl. check
pub const R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: u32 = 551;
/// TP-rel. LD/ST off. 11:0
pub const R_AARCH64_TLSLE_LDST8_TPREL_LO12: u32 = 552;
/// Likewise; no ovfl. check.
pub const R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC: u32 = 553;
/// TP-rel. LD/ST off. 11:1
pub const R_AARCH64_TLSLE_LDST16_TPREL_LO12: u32 = 554;
/// Likewise; no check
pub const R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC: u32 = 555;
/// TP-rel. LD/ST off. 11:2
pub const R_AARCH64_TLSLE_LDST32_TPREL_LO12: u32 = 556;
/// Likewise; no check
pub const R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC: u32 = 557;
/// TP-rel. LD/ST off. 11:3
pub const R_AARCH64_TLSLE_LDST64_TPREL_LO12: u32 = 558;
/// Likewise; no check
pub const R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC: u32 = 559;
/// PC-rel. load immediate 20:2
pub const R_AARCH64_TLSDESC_LD_PREL19: u32 = 560;
/// PC-rel. ADR immediate 20:0
pub const R_AARCH64_TLSDESC_ADR_PREL21: u32 = 561;
/// Page-rel. ADRP imm. 32:12
pub const R_AARCH64_TLSDESC_ADR_PAGE21: u32 = 562;
/// Direct LD off. from 11:3
pub const R_AARCH64_TLSDESC_LD64_LO12: u32 = 563;
/// Direct ADD imm. from 11:0
pub const R_AARCH64_TLSDESC_ADD_LO12: u32 = 564;
/// GOT-rel. MOV{N,Z} imm. 31:16
pub const R_AARCH64_TLSDESC_OFF_G1: u32 = 565;
/// GOT-rel. MOVK imm. 15:0; no ck
pub const R_AARCH64_TLSDESC_OFF_G0_NC: u32 = 566;
/// Relax LDR
pub const R_AARCH64_TLSDESC_LDR: u32 = 567;
/// Relax ADD
pub const R_AARCH64_TLSDESC_ADD: u32 = 568;
/// Relax BLR
pub const R_AARCH64_TLSDESC_CALL: u32 = 569;
/// TP-rel. LD/ST off. 11:4
pub const R_AARCH64_TLSLE_LDST128_TPREL_LO12: u32 = 570;
/// Likewise; no check
pub const R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC: u32 = 571;
/// DTP-rel. LD/ST imm. 11:4.
pub const R_AARCH64_TLSLD_LDST128_DTPREL_LO12: u32 = 572;
/// Likewise; no check
pub const R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC: u32 = 573;
/// Copy symbol at runtime
pub const R_AARCH64_COPY: u32 = 1024;
/// Create GOT entry
pub const R_AARCH64_GLOB_DAT: u32 = 1025;
/// Create PLT entry
pub const R_AARCH64_JUMP_SLOT: u32 = 1026;
/// Adjust by program base
pub const R_AARCH64_RELATIVE: u32 = 1027;
/// Module number, 64 bit
pub const R_AARCH64_TLS_DTPMOD: u32 = 1028;
/// Module-relative offset, 64 bit
pub const R_AARCH64_TLS_DTPREL: u32 = 1029;
/// TP-relative offset, 64 bit
pub const R_AARCH64_TLS_TPREL: u32 = 1030;
/// TLS Descriptor
pub const R_AARCH64_TLSDESC: u32 = 1031;
/// STT_GNU_IFUNC relocation
pub const R_AARCH64_IRELATIVE: u32 = 1032;

// ARM relocs
/// No reloc
pub const R_ARM_NONE: u32 = 0;
/// Deprecated PC relative 26 bit branch
pub const R_ARM_PC24: u32 = 1;
/// Direct 32 bit
pub const R_ARM_ABS32: u32 = 2;
/// PC relative 32 bit
pub const R_ARM_REL32: u32 = 3;
pub const R_ARM_PC13: u32 = 4;
/// Direct 16 bit
pub const R_ARM_ABS16: u32 = 5;
/// Direct 12 bit
pub const R_ARM_ABS12: u32 = 6;
/// Direct & 0x7C (LDR, STR)
pub const R_ARM_THM_ABS5: u32 = 7;
/// Direct 8 bit
pub const R_ARM_ABS8: u32 = 8;
pub const R_ARM_SBREL32: u32 = 9;
/// PC relative 24 bit (Thumb32 BL)
pub const R_ARM_THM_PC22: u32 = 10;
/// PC relative & 0x3FC(Thumb16 LDR, ADD, ADR).
pub const R_ARM_THM_PC8: u32 = 11;
pub const R_ARM_AMP_VCALL9: u32 = 12;
/// Obsolete static relocation
pub const R_ARM_SWI24: u32 = 13;
/// Dynamic relocation
pub const R_ARM_TLS_DESC: u32 = 13;
/// Reserved
pub const R_ARM_THM_SWI8: u32 = 14;
/// Reserved
pub const R_ARM_XPC25: u32 = 15;
/// Reserved
pub const R_ARM_THM_XPC22: u32 = 16;
/// ID of module containing symbol
pub const R_ARM_TLS_DTPMOD32: u32 = 17;
/// Offset in TLS block
pub const R_ARM_TLS_DTPOFF32: u32 = 18;
/// Offset in static TLS block
pub const R_ARM_TLS_TPOFF32: u32 = 19;
/// Copy symbol at runtime
pub const R_ARM_COPY: u32 = 20;
/// Create GOT entry
pub const R_ARM_GLOB_DAT: u32 = 21;
/// Create PLT entry
pub const R_ARM_JUMP_SLOT: u32 = 22;
/// Adjust by program base
pub const R_ARM_RELATIVE: u32 = 23;
/// 32 bit offset to GOT
pub const R_ARM_GOTOFF: u32 = 24;
/// 32 bit PC relative offset to GOT
pub const R_ARM_GOTPC: u32 = 25;
/// 32 bit GOT entry
pub const R_ARM_GOT32: u32 = 26;
/// Deprecated, 32 bit PLT address
pub const R_ARM_PLT32: u32 = 27;
/// PC relative 24 bit (BL, BLX)
pub const R_ARM_CALL: u32 = 28;
/// PC relative 24 bit (B, BL<cond>)
pub const R_ARM_JUMP24: u32 = 29;
/// PC relative 24 bit (Thumb32 B.W)
pub const R_ARM_THM_JUMP24: u32 = 30;
/// Adjust by program base
pub const R_ARM_BASE_ABS: u32 = 31;
/// Obsolete
pub const R_ARM_ALU_PCREL_7_0: u32 = 32;
/// Obsolete
pub const R_ARM_ALU_PCREL_15_8: u32 = 33;
/// Obsolete
pub const R_ARM_ALU_PCREL_23_15: u32 = 34;
/// Deprecated, prog. base relative
pub const R_ARM_LDR_SBREL_11_0: u32 = 35;
/// Deprecated, prog. base relative
pub const R_ARM_ALU_SBREL_19_12: u32 = 36;
/// Deprecated, prog. base relative
pub const R_ARM_ALU_SBREL_27_20: u32 = 37;
pub const R_ARM_TARGET1: u32 = 38;
/// Program base relative
pub const R_ARM_SBREL31: u32 = 39;
pub const R_ARM_V4BX: u32 = 40;
pub const R_ARM_TARGET2: u32 = 41;
/// 32 bit PC relative
pub const R_ARM_PREL31: u32 = 42;
/// Direct 16-bit (MOVW)
pub const R_ARM_MOVW_ABS_NC: u32 = 43;
/// Direct high 16-bit (MOVT)
pub const R_ARM_MOVT_ABS: u32 = 44;
/// PC relative 16-bit (MOVW)
pub const R_ARM_MOVW_PREL_NC: u32 = 45;
/// PC relative (MOVT)
pub const R_ARM_MOVT_PREL: u32 = 46;
/// Direct 16 bit (Thumb32 MOVW)
pub const R_ARM_THM_MOVW_ABS_NC: u32 = 47;
/// Direct high 16 bit (Thumb32 MOVT)
pub const R_ARM_THM_MOVT_ABS: u32 = 48;
/// PC relative 16 bit (Thumb32 MOVW)
pub const R_ARM_THM_MOVW_PREL_NC: u32 = 49;
/// PC relative high 16 bit (Thumb32 MOVT)
pub const R_ARM_THM_MOVT_PREL: u32 = 50;
/// PC relative 20 bit (Thumb32 B<cond>.W)
pub const R_ARM_THM_JUMP19: u32 = 51;
/// PC relative X & 0x7E (Thumb16 CBZ, CBNZ)
pub const R_ARM_THM_JUMP6: u32 = 52;
/// PC relative 12 bit (Thumb32 ADR.W)
pub const R_ARM_THM_ALU_PREL_11_0: u32 = 53;
/// PC relative 12 bit (Thumb32 LDR{D,SB,H,SH})
pub const R_ARM_THM_PC12: u32 = 54;
/// Direct 32-bit
pub const R_ARM_ABS32_NOI: u32 = 55;
/// PC relative 32-bit
pub const R_ARM_REL32_NOI: u32 = 56;
/// PC relative (ADD, SUB)
pub const R_ARM_ALU_PC_G0_NC: u32 = 57;
/// PC relative (ADD, SUB)
pub const R_ARM_ALU_PC_G0: u32 = 58;
/// PC relative (ADD, SUB)
pub const R_ARM_ALU_PC_G1_NC: u32 = 59;
/// PC relative (ADD, SUB)
pub const R_ARM_ALU_PC_G1: u32 = 60;
/// PC relative (ADD, SUB)
pub const R_ARM_ALU_PC_G2: u32 = 61;
/// PC relative (LDR,STR,LDRB,STRB)
pub const R_ARM_LDR_PC_G1: u32 = 62;
/// PC relative (LDR,STR,LDRB,STRB)
pub const R_ARM_LDR_PC_G2: u32 = 63;
/// PC relative (STR{D,H},LDR{D,SB,H,SH})
pub const R_ARM_LDRS_PC_G0: u32 = 64;
/// PC relative (STR{D,H},LDR{D,SB,H,SH})
pub const R_ARM_LDRS_PC_G1: u32 = 65;
/// PC relative (STR{D,H},LDR{D,SB,H,SH})
pub const R_ARM_LDRS_PC_G2: u32 = 66;
/// PC relative (LDC, STC)
pub const R_ARM_LDC_PC_G0: u32 = 67;
/// PC relative (LDC, STC)
pub const R_ARM_LDC_PC_G1: u32 = 68;
/// PC relative (LDC, STC)
pub const R_ARM_LDC_PC_G2: u32 = 69;
/// Program base relative (ADD,SUB)
pub const R_ARM_ALU_SB_G0_NC: u32 = 70;
/// Program base relative (ADD,SUB)
pub const R_ARM_ALU_SB_G0: u32 = 71;
/// Program base relative (ADD,SUB)
pub const R_ARM_ALU_SB_G1_NC: u32 = 72;
/// Program base relative (ADD,SUB)
pub const R_ARM_ALU_SB_G1: u32 = 73;
/// Program base relative (ADD,SUB)
pub const R_ARM_ALU_SB_G2: u32 = 74;
/// Program base relative (LDR,STR, LDRB, STRB)
pub const R_ARM_LDR_SB_G0: u32 = 75;
/// Program base relative (LDR, STR, LDRB, STRB)
pub const R_ARM_LDR_SB_G1: u32 = 76;
/// Program base relative (LDR, STR, LDRB, STRB)
pub const R_ARM_LDR_SB_G2: u32 = 77;
/// Program base relative (LDR, STR, LDRB, STRB)
pub const R_ARM_LDRS_SB_G0: u32 = 78;
/// Program base relative (LDR, STR, LDRB, STRB)
pub const R_ARM_LDRS_SB_G1: u32 = 79;
/// Program base relative (LDR, STR, LDRB, STRB)
pub const R_ARM_LDRS_SB_G2: u32 = 80;
/// Program base relative (LDC,STC)
pub const R_ARM_LDC_SB_G0: u32 = 81;
/// Program base relative (LDC,STC)
pub const R_ARM_LDC_SB_G1: u32 = 82;
/// Program base relative (LDC,STC)
pub const R_ARM_LDC_SB_G2: u32 = 83;
/// Program base relative 16 bit (MOVW)
pub const R_ARM_MOVW_BREL_NC: u32 = 84;
/// Program base relative high 16 bit (MOVT)
pub const R_ARM_MOVT_BREL: u32 = 85;
/// Program base relative 16 bit (MOVW)
pub const R_ARM_MOVW_BREL: u32 = 86;
/// Program base relative 16 bit (Thumb32 MOVW)
pub const R_ARM_THM_MOVW_BREL_NC: u32 = 87;
/// Program base relative high 16 bit (Thumb32 MOVT)
pub const R_ARM_THM_MOVT_BREL: u32 = 88;
/// Program base relative 16 bit (Thumb32 MOVW)
pub const R_ARM_THM_MOVW_BREL: u32 = 89;
pub const R_ARM_TLS_GOTDESC: u32 = 90;
pub const R_ARM_TLS_CALL: u32 = 91;
/// TLS relaxation
pub const R_ARM_TLS_DESCSEQ: u32 = 92;
pub const R_ARM_THM_TLS_CALL: u32 = 93;
pub const R_ARM_PLT32_ABS: u32 = 94;
/// GOT entry
pub const R_ARM_GOT_ABS: u32 = 95;
/// PC relative GOT entry
pub const R_ARM_GOT_PREL: u32 = 96;
/// GOT entry relative to GOT origin (LDR)
pub const R_ARM_GOT_BREL12: u32 = 97;
/// 12 bit, GOT entry relative to GOT origin (LDR, STR)
pub const R_ARM_GOTOFF12: u32 = 98;
pub const R_ARM_GOTRELAX: u32 = 99;
pub const R_ARM_GNU_VTENTRY: u32 = 100;
pub const R_ARM_GNU_VTINHERIT: u32 = 101;
/// PC relative & 0xFFE (Thumb16 B)
pub const R_ARM_THM_PC11: u32 = 102;
/// PC relative & 0x1FE (Thumb16 B/B<cond>)
pub const R_ARM_THM_PC9: u32 = 103;
/// PC-rel 32 bit for global dynamic thread local data
pub const R_ARM_TLS_GD32: u32 = 104;
/// PC-rel 32 bit for local dynamic thread local data
pub const R_ARM_TLS_LDM32: u32 = 105;
/// 32 bit offset relative to TLS block
pub const R_ARM_TLS_LDO32: u32 = 106;
/// PC-rel 32 bit for GOT entry of static TLS block offset
pub const R_ARM_TLS_IE32: u32 = 107;
/// 32 bit offset relative to static TLS block
pub const R_ARM_TLS_LE32: u32 = 108;
/// 12 bit relative to TLS block (LDR, STR)
pub const R_ARM_TLS_LDO12: u32 = 109;
/// 12 bit relative to static TLS block (LDR, STR)
pub const R_ARM_TLS_LE12: u32 = 110;
/// 12 bit GOT entry relative to GOT origin (LDR)
pub const R_ARM_TLS_IE12GP: u32 = 111;
/// Obsolete
pub const R_ARM_ME_TOO: u32 = 128;
pub const R_ARM_THM_TLS_DESCSEQ: u32 = 129;
pub const R_ARM_THM_TLS_DESCSEQ16: u32 = 129;
pub const R_ARM_THM_TLS_DESCSEQ32: u32 = 130;
/// GOT entry relative to GOT origin, 12 bit (Thumb32 LDR)
pub const R_ARM_THM_GOT_BREL12: u32 = 131;
pub const R_ARM_IRELATIVE: u32 = 160;
pub const R_ARM_RXPC25: u32 = 249;
pub const R_ARM_RSBREL32: u32 = 250;
pub const R_ARM_THM_RPC22: u32 = 251;
pub const R_ARM_RREL32: u32 = 252;
pub const R_ARM_RABS22: u32 = 253;
pub const R_ARM_RPC24: u32 = 254;
pub const R_ARM_RBASE: u32 = 255;
/// Keep this the last entry
pub const R_ARM_NUM: u32 = 256;

///////////////////
// OpenRisc
///////////////////
pub const R_OR1K_NONE: u32 = 0;
pub const R_OR1K_32: u32 = 1;
pub const R_OR1K_16: u32 = 2;
pub const R_OR1K_8: u32 = 3;
pub const R_OR1K_LO_16_IN_INSN: u32 = 4;
pub const R_OR1K_HI_16_IN_INSN: u32 = 5;
pub const R_OR1K_INSN_REL_26: u32 = 6;
pub const R_OR1K_GNU_VTENTRY: u32 = 7;
pub const R_OR1K_GNU_VTINHERIT: u32 = 8;
pub const R_OR1K_32_PCREL: u32 = 9;
pub const R_OR1K_16_PCREL: u32 = 10;
pub const R_OR1K_8_PCREL: u32 = 11;
pub const R_OR1K_GOTPC_HI16: u32 = 12;
pub const R_OR1K_GOTPC_LO16: u32 = 13;
pub const R_OR1K_GOT16: u32 = 14;
pub const R_OR1K_PLT26: u32 = 15;
pub const R_OR1K_GOTOFF_HI16: u32 = 16;
pub const R_OR1K_GOTOFF_LO16: u32 = 17;
pub const R_OR1K_COPY: u32 = 18;
pub const R_OR1K_GLOB_DAT: u32 = 19;
pub const R_OR1K_JMP_SLOT: u32 = 20;
pub const R_OR1K_RELATIVE: u32 = 21;
pub const R_OR1K_TLS_GD_HI16: u32 = 22;
pub const R_OR1K_TLS_GD_LO16: u32 = 23;
pub const R_OR1K_TLS_LDM_HI16: u32 = 24;
pub const R_OR1K_TLS_LDM_LO16: u32 = 25;
pub const R_OR1K_TLS_LDO_HI16: u32 = 26;
pub const R_OR1K_TLS_LDO_LO16: u32 = 27;
pub const R_OR1K_TLS_IE_HI16: u32 = 28;
pub const R_OR1K_TLS_IE_LO16: u32 = 29;
pub const R_OR1K_TLS_LE_HI16: u32 = 30;
pub const R_OR1K_TLS_LE_LO16: u32 = 31;
pub const R_OR1K_TLS_TPOFF: u32 = 32;
pub const R_OR1K_TLS_DTPOFF: u32 = 33;
pub const R_OR1K_TLS_DTPMOD: u32 = 34;
pub const R_OR1K_NUM: u32 = 35;

/////////////////////
// MIPS
/////////////////////
/// No reloc
pub const R_MIPS_NONE: u32 = 0;
/// Direct 16 bit
pub const R_MIPS_16: u32 = 1;
/// Direct 32 bit
pub const R_MIPS_32: u32 = 2;
/// PC relative 32 bit
pub const R_MIPS_REL32: u32 = 3;
/// Direct 26 bit shifted
pub const R_MIPS_26: u32 = 4;
/// High 16 bit
pub const R_MIPS_HI16: u32 = 5;
/// Low 16 bit
pub const R_MIPS_LO16: u32 = 6;
/// GP relative 16 bit
pub const R_MIPS_GPREL16: u32 = 7;
/// 16 bit literal entry
pub const R_MIPS_LITERAL: u32 = 8;
/// 16 bit GOT entry
pub const R_MIPS_GOT16: u32 = 9;
/// PC relative 16 bit
pub const R_MIPS_PC16: u32 = 10;
/// 16 bit GOT entry for function
pub const R_MIPS_CALL16: u32 = 11;
/// GP relative 32 bit
pub const R_MIPS_GPREL32: u32 = 12;
pub const R_MIPS_SHIFT5: u32 = 16;
pub const R_MIPS_SHIFT6: u32 = 17;
pub const R_MIPS_64: u32 = 18;
pub const R_MIPS_GOT_DISP: u32 = 19;
pub const R_MIPS_GOT_PAGE: u32 = 20;
pub const R_MIPS_GOT_OFST: u32 = 21;
pub const R_MIPS_GOT_HI16: u32 = 22;
pub const R_MIPS_GOT_LO16: u32 = 23;
pub const R_MIPS_SUB: u32 = 24;
pub const R_MIPS_INSERT_A: u32 = 25;
pub const R_MIPS_INSERT_B: u32 = 26;
pub const R_MIPS_DELETE: u32 = 27;
pub const R_MIPS_HIGHER: u32 = 28;
pub const R_MIPS_HIGHEST: u32 = 29;
pub const R_MIPS_CALL_HI16: u32 = 30;
pub const R_MIPS_CALL_LO16: u32 = 31;
pub const R_MIPS_SCN_DISP: u32 = 32;
pub const R_MIPS_REL16: u32 = 33;
pub const R_MIPS_ADD_IMMEDIATE: u32 = 34;
pub const R_MIPS_PJUMP: u32 = 35;
pub const R_MIPS_RELGOT: u32 = 36;
pub const R_MIPS_JALR: u32 = 37;
/// Module number 32 bit
pub const R_MIPS_TLS_DTPMOD32: u32 = 38;
/// Module-relative offset 32 bit
pub const R_MIPS_TLS_DTPREL32: u32 = 39;
/// Module number 64 bit
pub const R_MIPS_TLS_DTPMOD64: u32 = 40;
/// Module-relative offset 64 bit
pub const R_MIPS_TLS_DTPREL64: u32 = 41;
/// 16 bit GOT offset for GD
pub const R_MIPS_TLS_GD: u32 = 42;
/// 16 bit GOT offset for LDM
pub const R_MIPS_TLS_LDM: u32 = 43;
/// Module-relative offset, high 16 bits
pub const R_MIPS_TLS_DTPREL_HI16: u32 = 44;
/// Module-relative offset, low 16 bits
pub const R_MIPS_TLS_DTPREL_LO16: u32 = 45;
/// 16 bit GOT offset for IE
pub const R_MIPS_TLS_GOTTPREL: u32 = 46;
/// TP-relative offset, 32 bit6
pub const R_MIPS_TLS_TPREL32: u32 = 47;
/// TP-relative offset, 64 bit
pub const R_MIPS_TLS_TPREL64: u32 = 48;
/// TP-relative offset, high 16 bits
pub const R_MIPS_TLS_TPREL_HI16: u32 = 49;
/// TP-relative offset, low 16 bits
pub const R_MIPS_TLS_TPREL_LO16: u32 = 50;
pub const R_MIPS_GLOB_DAT: u32 = 51;
pub const R_MIPS_COPY: u32 = 126;
pub const R_MIPS_JUMP_SLOT: u32 = 127;
pub const R_MIPS_NUM: u32 = 128;

///////////////////
// RISC-V
// See https://github.com/riscv/riscv-elf-psabi-doc
///////////////////
/// None
pub const R_RISCV_NONE: u32 = 0;
/// Runtime relocation: word32 = S + A
pub const R_RISCV_32: u32 = 1;
/// Runtime relocation: word64 = S + A
pub const R_RISCV_64: u32 = 2;
/// Runtime relocation: word32,64 = B + A
pub const R_RISCV_RELATIVE: u32 = 3;
/// Runtime relocation: must be in executable, not allowed in shared library
pub const R_RISCV_COPY: u32 = 4;
/// Runtime relocation: word32,64 = S; handled by PLT unless LD_BIND_NOW
pub const R_RISCV_JUMP_SLOT: u32 = 5;
/// TLS relocation: word32 = S->TLSINDEX
pub const R_RISCV_TLS_DTPMOD32: u32 = 6;
/// TLS relocation: word64 = S->TLSINDEX
pub const R_RISCV_TLS_DTPMOD64: u32 = 7;
/// TLS relocation: word32 = TLS + S + A - TLS_TP_OFFSET
pub const R_RISCV_TLS_DTPREL32: u32 = 8;
/// TLS relocation: word64 = TLS + S + A - TLS_TP_OFFSET
pub const R_RISCV_TLS_DTPREL64: u32 = 9;
/// TLS relocation: word32 = TLS + S + A + S_TLS_OFFSET - TLS_DTV_OFFSET
pub const R_RISCV_TLS_TPREL32: u32 = 10;
/// TLS relocation: word64 = TLS + S + A + S_TLS_OFFSET - TLS_DTV_OFFSET
pub const R_RISCV_TLS_TPREL64: u32 = 11;
/// PC-relative branch (SB-Type)
pub const R_RISCV_BRANCH: u32 = 16;
/// PC-relative jump (UJ-Type)
pub const R_RISCV_JAL: u32 = 17;
/// PC-relative call: MACRO call,tail (auipc+jalr pair)
pub const R_RISCV_CALL: u32 = 18;
/// PC-relative call (PLT): MACRO call,tail (auipc+jalr pair) PIC
pub const R_RISCV_CALL_PLT: u32 = 19;
/// PC-relative GOT reference: MACRO la
pub const R_RISCV_GOT_HI20: u32 = 20;
/// PC-relative TLS IE GOT offset: MACRO la.tls.ie
pub const R_RISCV_TLS_GOT_HI20: u32 = 21;
/// PC-relative TLS GD reference: MACRO la.tls.gd
pub const R_RISCV_TLS_GD_HI20: u32 = 22;
/// PC-relative reference: %pcrel_hi(symbol) (U-Type)
pub const R_RISCV_PCREL_HI20: u32 = 23;
/// PC-relative reference: %pcrel_lo(symbol) (I-Type)
pub const R_RISCV_PCREL_LO12_I: u32 = 24;
/// PC-relative reference: %pcrel_lo(symbol) (S-Type)
pub const R_RISCV_PCREL_LO12_S: u32 = 25;
/// Absolute address: %hi(symbol) (U-Type)
pub const R_RISCV_HI20: u32 = 26;
/// Absolute address: %lo(symbol) (I-Type)
pub const R_RISCV_LO12_I: u32 = 27;
/// Absolute address: %lo(symbol) (S-Type)
pub const R_RISCV_LO12_S: u32 = 28;
/// TLS LE thread offset: %tprel_hi(symbol) (U-Type)
pub const R_RISCV_TPREL_HI20: u32 = 29;
/// TLS LE thread offset: %tprel_lo(symbol) (I-Type)
pub const R_RISCV_TPREL_LO12_I: u32 = 30;
/// TLS LE thread offset: %tprel_lo(symbol) (S-Type)
pub const R_RISCV_TPREL_LO12_S: u32 = 31;
/// TLS LE thread usage: %tprel_add(symbol)
pub const R_RISCV_TPREL_ADD: u32 = 32;
/// 8-bit label addition: word8 = S + A
pub const R_RISCV_ADD8: u32 = 33;
/// 16-bit label addition: word16 = S + A
pub const R_RISCV_ADD16: u32 = 34;
/// 32-bit label addition: word32 = S + A
pub const R_RISCV_ADD32: u32 = 35;
/// 64-bit label addition: word64 = S + A
pub const R_RISCV_ADD64: u32 = 36;
/// 8-bit label subtraction: word8 = S - A
pub const R_RISCV_SUB8: u32 = 37;
/// 16-bit label subtraction: word16 = S - A
pub const R_RISCV_SUB16: u32 = 38;
/// 32-bit label subtraction: word32 = S - A
pub const R_RISCV_SUB32: u32 = 39;
/// 64-bit label subtraction: word64 = S - A
pub const R_RISCV_SUB64: u32 = 40;
/// GNU C++ vtable hierarchy
pub const R_RISCV_GNU_VTINHERIT: u32 = 41;
/// GNU C++ vtable member usage
pub const R_RISCV_GNU_VTENTRY: u32 = 42;
/// Alignment statement
pub const R_RISCV_ALIGN: u32 = 43;
/// PC-relative branch offset (CB-Type)
pub const R_RISCV_RVC_BRANCH: u32 = 44;
/// PC-relative jump offset (CJ-Type)
pub const R_RISCV_RVC_JUMP: u32 = 45;
/// Absolute address (CI-Type)
pub const R_RISCV_RVC_LUI: u32 = 46;
/// GP-relative reference (I-Type)
pub const R_RISCV_GPREL_I: u32 = 47;
/// GP-relative reference (S-Type)
pub const R_RISCV_GPREL_S: u32 = 48;
/// TP-relative TLS LE load (I-Type)
pub const R_RISCV_TPREL_I: u32 = 49;
/// TP-relative TLS LE store (S-Type)
pub const R_RISCV_TPREL_S: u32 = 50;
/// Instruction pair can be relaxed
pub const R_RISCV_RELAX: u32 = 51;
/// Local label subtraction
pub const R_RISCV_SUB6: u32 = 52;
/// Local label subtraction
pub const R_RISCV_SET6: u32 = 53;
/// Local label subtraction
pub const R_RISCV_SET8: u32 = 54;
/// Local label subtraction
pub const R_RISCV_SET16: u32 = 55;
/// Local label subtraction
pub const R_RISCV_SET32: u32 = 56;

#[inline]
pub fn r_to_str(typ: u32, machine: u16) -> &'static str {
    use crate::elf::header::*;
    match machine {
        // x86
        EM_386 => { match typ {
        R_386_NONE => "386_NONE",
        R_386_32 => "386_32",
        R_386_PC32 => "386_PC32",
        R_386_GOT32 => "386_GOT32",
        R_386_PLT32 => "386_PLT32",
        R_386_COPY => "386_COPY",
        R_386_GLOB_DAT => "386_GLOB_DAT",
        R_386_JMP_SLOT => "386_JMP_SLOT",
        R_386_RELATIVE => "386_RELATIVE",
        R_386_GOTOFF => "386_GOTOFF",
        R_386_GOTPC => "386_GOTPC",
        R_386_32PLT => "386_32PLT",
        R_386_TLS_TPOFF => "386_TLS_TPOFF",
        R_386_TLS_IE => "386_TLS_IE",
        R_386_TLS_GOTIE => "386_TLS_GOTIE",
        R_386_TLS_LE => "386_TLS_LE",
        R_386_TLS_GD => "386_TLS_GD",
        R_386_TLS_LDM => "386_TLS_LDM",
        R_386_16 => "386_16",
        R_386_PC16 => "386_PC16",
        R_386_8 => "386_8",
        R_386_PC8 => "386_PC8",
        R_386_TLS_GD_32 => "386_TLS_GD_32",
        R_386_TLS_GD_PUSH => "386_TLS_GD_PUSH",
        R_386_TLS_GD_CALL => "386_TLS_GD_CALL",
        R_386_TLS_GD_POP => "386_TLS_GD_POP",
        R_386_TLS_LDM_32 => "386_TLS_LDM_32",
        R_386_TLS_LDM_PUSH => "386_TLS_LDM_PUSH",
        R_386_TLS_LDM_CALL => "386_TLS_LDM_CALL",
        R_386_TLS_LDM_POP => "386_TLS_LDM_POP",
        R_386_TLS_LDO_32 => "386_TLS_LDO_32",
        R_386_TLS_IE_32 => "386_TLS_IE_32",
        R_386_TLS_LE_32 => "386_TLS_LE_32",
        R_386_TLS_DTPMOD32 => "386_TLS_DTPMOD32",
        R_386_TLS_DTPOFF32 => "386_TLS_DTPOFF32",
        R_386_TLS_TPOFF32 => "386_TLS_TPOFF32",
        R_386_SIZE32 => "386_SIZE32",
        R_386_TLS_GOTDESC => "386_TLS_GOTDESC",
        R_386_TLS_DESC_CALL => "386_TLS_DESC_CALL",
        R_386_TLS_DESC => "386_TLS_DESC",
        R_386_IRELATIVE => "386_IRELATIVE",
        R_386_GOT32X => "386_GOT32X",
        _ => "R_UNKNOWN_386",
        }},
        EM_X86_64 => { match typ {
        R_X86_64_64 => "X86_64_64",
        R_X86_64_PC32 => "X86_64_PC32",
        R_X86_64_GOT32 => "X86_64_GOT32",
        R_X86_64_PLT32 => "X86_64_PLT32",
        R_X86_64_COPY => "X86_64_COPY",
        R_X86_64_GLOB_DAT => "X86_64_GLOB_DAT",
        R_X86_64_JUMP_SLOT => "X86_64_JUMP_SLOT",
        R_X86_64_RELATIVE => "X86_64_RELATIVE",
        R_X86_64_GOTPCREL => "X86_64_GOTPCREL",
        R_X86_64_32 => "X86_64_32",
        R_X86_64_32S => "X86_64_32S",
        R_X86_64_16 => "X86_64_16",
        R_X86_64_PC16 => "X86_64_PC16",
        R_X86_64_8 => "X86_64_8",
        R_X86_64_PC8 => "X86_64_PC8",
        R_X86_64_DTPMOD64 => "X86_64_DTPMOD64",
        R_X86_64_DTPOFF64 => "X86_64_DTPOFF64",
        R_X86_64_TPOFF64 => "X86_64_TPOFF64",
        R_X86_64_TLSGD => "X86_64_TLSGD",
        R_X86_64_TLSLD => "X86_64_TLSLD",
        R_X86_64_DTPOFF32 => "X86_64_DTPOFF32",
        R_X86_64_GOTTPOFF => "X86_64_GOTTPOFF",
        R_X86_64_TPOFF32 => "X86_64_TPOFF32",
        R_X86_64_PC64 => "X86_64_PC64",
        R_X86_64_GOTOFF64 => "X86_64_GOTOFF64",
        R_X86_64_GOTPC32 => "X86_64_GOTPC32",
        R_X86_64_GOT64 => "X86_64_GOT64",
        R_X86_64_GOTPCREL64 => "X86_64_GOTPCREL64",
        R_X86_64_GOTPC64 => "X86_64_GOTPC64",
        R_X86_64_GOTPLT64 => "X86_64_GOTPLT64",
        R_X86_64_PLTOFF64 => "X86_64_PLTOFF64",
        R_X86_64_SIZE32 => "X86_64_SIZE32",
        R_X86_64_SIZE64 => "X86_64_SIZE64",
        R_X86_64_GOTPC32_TLSDESC => "X86_64_GOTPC32_TLSDESC",
        R_X86_64_TLSDESC_CALL => "X86_64_TLSDESC_CALL",
        R_X86_64_TLSDESC => "X86_64_TLSDESC",
        R_X86_64_IRELATIVE => "X86_64_IRELATIVE",
        R_X86_64_RELATIVE64 => "X86_64_RELATIVE64",
        R_X86_64_GOTPCRELX => "R_X86_64_GOTPCRELX",
        R_X86_64_REX_GOTPCRELX => "R_X86_64_REX_GOTPCRELX",
        _ => "R_UNKNOWN_X86_64",
        }},
        // openrisc
        EM_OPENRISC => { match typ {
        R_OR1K_NONE => "OR1K_NONE",
        R_OR1K_32 => "OR1K_32",
        R_OR1K_16 => "OR1K_16",
        R_OR1K_8 => "OR1K_8",
        R_OR1K_LO_16_IN_INSN => "OR1K_LO_16_IN_INSN",
        R_OR1K_HI_16_IN_INSN => "OR1K_HI_16_IN_INSN",
        R_OR1K_INSN_REL_26 => "OR1K_INSN_REL_26",
        R_OR1K_GNU_VTENTRY => "OR1K_GNU_VTENTRY",
        R_OR1K_GNU_VTINHERIT => "OR1K_GNU_VTINHERIT",
        R_OR1K_32_PCREL => "OR1K_32_PCREL",
        R_OR1K_16_PCREL => "OR1K_16_PCREL",
        R_OR1K_8_PCREL => "OR1K_8_PCREL",
        R_OR1K_GOTPC_HI16 => "OR1K_GOTPC_HI16",
        R_OR1K_GOTPC_LO16 => "OR1K_GOTPC_LO16",
        R_OR1K_GOT16 => "OR1K_GOT16",
        R_OR1K_PLT26 => "OR1K_PLT26",
        R_OR1K_GOTOFF_HI16 => "OR1K_GOTOFF_HI16",
        R_OR1K_GOTOFF_LO16 => "OR1K_GOTOFF_LO16",
        R_OR1K_COPY => "OR1K_COPY",
        R_OR1K_GLOB_DAT => "OR1K_GLOB_DAT",
        R_OR1K_JMP_SLOT => "OR1K_JMP_SLOT",
        R_OR1K_RELATIVE => "OR1K_RELATIVE",
        R_OR1K_TLS_GD_HI16 => "OR1K_TLS_GD_HI16",
        R_OR1K_TLS_GD_LO16 => "OR1K_TLS_GD_LO16",
        R_OR1K_TLS_LDM_HI16 => "OR1K_TLS_LDM_HI16",
        R_OR1K_TLS_LDM_LO16 => "OR1K_TLS_LDM_LO16",
        R_OR1K_TLS_LDO_HI16 => "OR1K_TLS_LDO_HI16",
        R_OR1K_TLS_LDO_LO16 => "OR1K_TLS_LDO_LO16",
        R_OR1K_TLS_IE_HI16 => "OR1K_TLS_IE_HI16",
        R_OR1K_TLS_IE_LO16 => "OR1K_TLS_IE_LO16",
        R_OR1K_TLS_LE_HI16 => "OR1K_TLS_LE_HI16",
        R_OR1K_TLS_LE_LO16 => "OR1K_TLS_LE_LO16",
        R_OR1K_TLS_TPOFF => "OR1K_TLS_TPOFF",
        R_OR1K_TLS_DTPOFF => "OR1K_TLS_DTPOFF",
        R_OR1K_TLS_DTPMOD => "OR1K_TLS_DTPMOD",
        _ => "R_UNKNOWN_OR1K",
        }},
        // arm64
        EM_AARCH64 => { match typ {
        R_AARCH64_P32_ABS32 => "AARCH64_P32_ABS32",
        R_AARCH64_P32_COPY => "AARCH64_P32_COPY",
        R_AARCH64_P32_GLOB_DAT => "AARCH64_P32_GLOB_DAT",
        R_AARCH64_P32_JUMP_SLOT => "AARCH64_P32_JUMP_SLOT",
        R_AARCH64_P32_RELATIVE => "AARCH64_P32_RELATIVE",
        R_AARCH64_P32_TLS_DTPMOD => "AARCH64_P32_TLS_DTPMOD",
        R_AARCH64_P32_TLS_DTPREL => "AARCH64_P32_TLS_DTPREL",
        R_AARCH64_P32_TLS_TPREL => "AARCH64_P32_TLS_TPREL",
        R_AARCH64_P32_TLSDESC => "AARCH64_P32_TLSDESC",
        R_AARCH64_P32_IRELATIVE => "AARCH64_P32_IRELATIVE",
        R_AARCH64_ABS64 => "AARCH64_ABS64",
        R_AARCH64_ABS32 => "AARCH64_ABS32",
        R_AARCH64_ABS16 => "AARCH64_ABS16",
        R_AARCH64_PREL64 => "AARCH64_PREL64",
        R_AARCH64_PREL32 => "AARCH64_PREL32",
        R_AARCH64_PREL16 => "AARCH64_PREL16",
        R_AARCH64_MOVW_UABS_G0 => "AARCH64_MOVW_UABS_G0",
        R_AARCH64_MOVW_UABS_G0_NC => "AARCH64_MOVW_UABS_G0_NC",
        R_AARCH64_MOVW_UABS_G1 => "AARCH64_MOVW_UABS_G1",
        R_AARCH64_MOVW_UABS_G1_NC => "AARCH64_MOVW_UABS_G1_NC",
        R_AARCH64_MOVW_UABS_G2 => "AARCH64_MOVW_UABS_G2",
        R_AARCH64_MOVW_UABS_G2_NC => "AARCH64_MOVW_UABS_G2_NC",
        R_AARCH64_MOVW_UABS_G3 => "AARCH64_MOVW_UABS_G3",
        R_AARCH64_MOVW_SABS_G0 => "AARCH64_MOVW_SABS_G0",
        R_AARCH64_MOVW_SABS_G1 => "AARCH64_MOVW_SABS_G1",
        R_AARCH64_MOVW_SABS_G2 => "AARCH64_MOVW_SABS_G2",
        R_AARCH64_LD_PREL_LO19 => "AARCH64_LD_PREL_LO19",
        R_AARCH64_ADR_PREL_LO21 => "AARCH64_ADR_PREL_LO21",
        R_AARCH64_ADR_PREL_PG_HI21 => "AARCH64_ADR_PREL_PG_HI21",
        R_AARCH64_ADR_PREL_PG_HI21_NC => "AARCH64_ADR_PREL_PG_HI21_NC",
        R_AARCH64_ADD_ABS_LO12_NC => "AARCH64_ADD_ABS_LO12_NC",
        R_AARCH64_LDST8_ABS_LO12_NC => "AARCH64_LDST8_ABS_LO12_NC",
        R_AARCH64_TSTBR14 => "AARCH64_TSTBR14",
        R_AARCH64_CONDBR19 => "AARCH64_CONDBR19",
        R_AARCH64_JUMP26 => "AARCH64_JUMP26",
        R_AARCH64_CALL26 => "AARCH64_CALL26",
        R_AARCH64_LDST16_ABS_LO12_NC => "AARCH64_LDST16_ABS_LO12_NC",
        R_AARCH64_LDST32_ABS_LO12_NC => "AARCH64_LDST32_ABS_LO12_NC",
        R_AARCH64_LDST64_ABS_LO12_NC => "AARCH64_LDST64_ABS_LO12_NC",
        R_AARCH64_MOVW_PREL_G0 => "AARCH64_MOVW_PREL_G0",
        R_AARCH64_MOVW_PREL_G0_NC => "AARCH64_MOVW_PREL_G0_NC",
        R_AARCH64_MOVW_PREL_G1 => "AARCH64_MOVW_PREL_G1",
        R_AARCH64_MOVW_PREL_G1_NC => "AARCH64_MOVW_PREL_G1_NC",
        R_AARCH64_MOVW_PREL_G2 => "AARCH64_MOVW_PREL_G2",
        R_AARCH64_MOVW_PREL_G2_NC => "AARCH64_MOVW_PREL_G2_NC",
        R_AARCH64_MOVW_PREL_G3 => "AARCH64_MOVW_PREL_G3",
        R_AARCH64_LDST128_ABS_LO12_NC => "AARCH64_LDST128_ABS_LO12_NC",
        R_AARCH64_MOVW_GOTOFF_G0 => "AARCH64_MOVW_GOTOFF_G0",
        R_AARCH64_MOVW_GOTOFF_G0_NC => "AARCH64_MOVW_GOTOFF_G0_NC",
        R_AARCH64_MOVW_GOTOFF_G1 => "AARCH64_MOVW_GOTOFF_G1",
        R_AARCH64_MOVW_GOTOFF_G1_NC => "AARCH64_MOVW_GOTOFF_G1_NC",
        R_AARCH64_MOVW_GOTOFF_G2 => "AARCH64_MOVW_GOTOFF_G2",
        R_AARCH64_MOVW_GOTOFF_G2_NC => "AARCH64_MOVW_GOTOFF_G2_NC",
        R_AARCH64_MOVW_GOTOFF_G3 => "AARCH64_MOVW_GOTOFF_G3",
        R_AARCH64_GOTREL64 => "AARCH64_GOTREL64",
        R_AARCH64_GOTREL32 => "AARCH64_GOTREL32",
        R_AARCH64_GOT_LD_PREL19 => "AARCH64_GOT_LD_PREL19",
        R_AARCH64_LD64_GOTOFF_LO15 => "AARCH64_LD64_GOTOFF_LO15",
        R_AARCH64_ADR_GOT_PAGE => "AARCH64_ADR_GOT_PAGE",
        R_AARCH64_LD64_GOT_LO12_NC => "AARCH64_LD64_GOT_LO12_NC",
        R_AARCH64_LD64_GOTPAGE_LO15 => "AARCH64_LD64_GOTPAGE_LO15",
        R_AARCH64_TLSGD_ADR_PREL21 => "AARCH64_TLSGD_ADR_PREL21",
        R_AARCH64_TLSGD_ADR_PAGE21 => "AARCH64_TLSGD_ADR_PAGE21",
        R_AARCH64_TLSGD_ADD_LO12_NC => "AARCH64_TLSGD_ADD_LO12_NC",
        R_AARCH64_TLSGD_MOVW_G1 => "AARCH64_TLSGD_MOVW_G1",
        R_AARCH64_TLSGD_MOVW_G0_NC => "AARCH64_TLSGD_MOVW_G0_NC",
        R_AARCH64_TLSLD_ADR_PREL21 => "AARCH64_TLSLD_ADR_PREL21",
        R_AARCH64_TLSLD_ADR_PAGE21 => "AARCH64_TLSLD_ADR_PAGE21",
        R_AARCH64_TLSLD_ADD_LO12_NC => "AARCH64_TLSLD_ADD_LO12_NC",
        R_AARCH64_TLSLD_MOVW_G1 => "AARCH64_TLSLD_MOVW_G1",
        R_AARCH64_TLSLD_MOVW_G0_NC => "AARCH64_TLSLD_MOVW_G0_NC",
        R_AARCH64_TLSLD_LD_PREL19 => "AARCH64_TLSLD_LD_PREL19",
        R_AARCH64_TLSLD_MOVW_DTPREL_G2 => "AARCH64_TLSLD_MOVW_DTPREL_G2",
        R_AARCH64_TLSLD_MOVW_DTPREL_G1 => "AARCH64_TLSLD_MOVW_DTPREL_G1",
        R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC => "AARCH64_TLSLD_MOVW_DTPREL_G1_NC",
        R_AARCH64_TLSLD_MOVW_DTPREL_G0 => "AARCH64_TLSLD_MOVW_DTPREL_G0",
        R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC => "AARCH64_TLSLD_MOVW_DTPREL_G0_NC",
        R_AARCH64_TLSLD_ADD_DTPREL_HI12 => "AARCH64_TLSLD_ADD_DTPREL_HI12",
        R_AARCH64_TLSLD_ADD_DTPREL_LO12 => "AARCH64_TLSLD_ADD_DTPREL_LO12",
        R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC => "AARCH64_TLSLD_ADD_DTPREL_LO12_NC",
        R_AARCH64_TLSLD_LDST8_DTPREL_LO12 => "AARCH64_TLSLD_LDST8_DTPREL_LO12",
        R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC => "AARCH64_TLSLD_LDST8_DTPREL_LO12_NC",
        R_AARCH64_TLSLD_LDST16_DTPREL_LO12 => "AARCH64_TLSLD_LDST16_DTPREL_LO12",
        R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC => "AARCH64_TLSLD_LDST16_DTPREL_LO12_NC",
        R_AARCH64_TLSLD_LDST32_DTPREL_LO12 => "AARCH64_TLSLD_LDST32_DTPREL_LO12",
        R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC => "AARCH64_TLSLD_LDST32_DTPREL_LO12_NC",
        R_AARCH64_TLSLD_LDST64_DTPREL_LO12 => "AARCH64_TLSLD_LDST64_DTPREL_LO12",
        R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC => "AARCH64_TLSLD_LDST64_DTPREL_LO12_NC",
        R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 => "AARCH64_TLSIE_MOVW_GOTTPREL_G1",
        R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC => "AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC",
        R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 => "AARCH64_TLSIE_ADR_GOTTPREL_PAGE21",
        R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC => "AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC",
        R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 => "AARCH64_TLSIE_LD_GOTTPREL_PREL19",
        R_AARCH64_TLSLE_MOVW_TPREL_G2 => "AARCH64_TLSLE_MOVW_TPREL_G2",
        R_AARCH64_TLSLE_MOVW_TPREL_G1 => "AARCH64_TLSLE_MOVW_TPREL_G1",
        R_AARCH64_TLSLE_MOVW_TPREL_G1_NC => "AARCH64_TLSLE_MOVW_TPREL_G1_NC",
        R_AARCH64_TLSLE_MOVW_TPREL_G0 => "AARCH64_TLSLE_MOVW_TPREL_G0",
        R_AARCH64_TLSLE_MOVW_TPREL_G0_NC => "AARCH64_TLSLE_MOVW_TPREL_G0_NC",
        R_AARCH64_TLSLE_ADD_TPREL_HI12 => "AARCH64_TLSLE_ADD_TPREL_HI12",
        R_AARCH64_TLSLE_ADD_TPREL_LO12 => "AARCH64_TLSLE_ADD_TPREL_LO12",
        R_AARCH64_TLSLE_ADD_TPREL_LO12_NC => "AARCH64_TLSLE_ADD_TPREL_LO12_NC",
        R_AARCH64_TLSLE_LDST8_TPREL_LO12 => "AARCH64_TLSLE_LDST8_TPREL_LO12",
        R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC => "AARCH64_TLSLE_LDST8_TPREL_LO12_NC",
        R_AARCH64_TLSLE_LDST16_TPREL_LO12 => "AARCH64_TLSLE_LDST16_TPREL_LO12",
        R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC => "AARCH64_TLSLE_LDST16_TPREL_LO12_NC",
        R_AARCH64_TLSLE_LDST32_TPREL_LO12 => "AARCH64_TLSLE_LDST32_TPREL_LO12",
        R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC => "AARCH64_TLSLE_LDST32_TPREL_LO12_NC",
        R_AARCH64_TLSLE_LDST64_TPREL_LO12 => "AARCH64_TLSLE_LDST64_TPREL_LO12",
        R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC => "AARCH64_TLSLE_LDST64_TPREL_LO12_NC",
        R_AARCH64_TLSDESC_LD_PREL19 => "AARCH64_TLSDESC_LD_PREL19",
        R_AARCH64_TLSDESC_ADR_PREL21 => "AARCH64_TLSDESC_ADR_PREL21",
        R_AARCH64_TLSDESC_ADR_PAGE21 => "AARCH64_TLSDESC_ADR_PAGE21",
        R_AARCH64_TLSDESC_LD64_LO12 => "AARCH64_TLSDESC_LD64_LO12",
        R_AARCH64_TLSDESC_ADD_LO12 => "AARCH64_TLSDESC_ADD_LO12",
        R_AARCH64_TLSDESC_OFF_G1 => "AARCH64_TLSDESC_OFF_G1",
        R_AARCH64_TLSDESC_OFF_G0_NC => "AARCH64_TLSDESC_OFF_G0_NC",
        R_AARCH64_TLSDESC_LDR => "AARCH64_TLSDESC_LDR",
        R_AARCH64_TLSDESC_ADD => "AARCH64_TLSDESC_ADD",
        R_AARCH64_TLSDESC_CALL => "AARCH64_TLSDESC_CALL",
        R_AARCH64_TLSLE_LDST128_TPREL_LO12 => "AARCH64_TLSLE_LDST128_TPREL_LO12",
        R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC => "AARCH64_TLSLE_LDST128_TPREL_LO12_NC",
        R_AARCH64_TLSLD_LDST128_DTPREL_LO12 => "AARCH64_TLSLD_LDST128_DTPREL_LO12",
        R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC => "AARCH64_TLSLD_LDST128_DTPREL_LO12_NC",
        R_AARCH64_COPY => "AARCH64_COPY",
        R_AARCH64_GLOB_DAT => "AARCH64_GLOB_DAT",
        R_AARCH64_JUMP_SLOT => "AARCH64_JUMP_SLOT",
        R_AARCH64_RELATIVE => "AARCH64_RELATIVE",
        R_AARCH64_TLS_DTPMOD => "AARCH64_TLS_DTPMOD",
        R_AARCH64_TLS_DTPREL => "AARCH64_TLS_DTPREL",
        R_AARCH64_TLS_TPREL => "AARCH64_TLS_TPREL",
        R_AARCH64_TLSDESC => "AARCH64_TLSDESC",
        R_AARCH64_IRELATIVE => "AARCH64_IRELATIVE",
         _ => "R_UNKNOWN_AARCH64",
        }},
        // arm
        EM_ARM => { match typ {
        R_ARM_PC24 => "ARM_PC24",
        R_ARM_ABS32 => "ARM_ABS32",
        R_ARM_REL32 => "ARM_REL32",
        R_ARM_PC13 => "ARM_PC13",
        R_ARM_ABS16 => "ARM_ABS16",
        R_ARM_ABS12 => "ARM_ABS12",
        R_ARM_THM_ABS5 => "ARM_THM_ABS5",
        R_ARM_ABS8 => "ARM_ABS8",
        R_ARM_SBREL32 => "ARM_SBREL32",
        R_ARM_THM_PC22 => "ARM_THM_PC22",
        R_ARM_THM_PC8 => "ARM_THM_PC8",
        R_ARM_AMP_VCALL9 => "ARM_AMP_VCALL9",
        R_ARM_TLS_DESC => "ARM_TLS_DESC",
        R_ARM_THM_SWI8 => "ARM_THM_SWI8",
        R_ARM_XPC25 => "ARM_XPC25",
        R_ARM_THM_XPC22 => "ARM_THM_XPC22",
        R_ARM_TLS_DTPMOD32 => "ARM_TLS_DTPMOD32",
        R_ARM_TLS_DTPOFF32 => "ARM_TLS_DTPOFF32",
        R_ARM_TLS_TPOFF32 => "ARM_TLS_TPOFF32",
        R_ARM_COPY => "ARM_COPY",
        R_ARM_GLOB_DAT => "ARM_GLOB_DAT",
        R_ARM_JUMP_SLOT => "ARM_JUMP_SLOT",
        R_ARM_RELATIVE => "ARM_RELATIVE",
        R_ARM_GOTOFF => "ARM_GOTOFF",
        R_ARM_GOTPC => "ARM_GOTPC",
        R_ARM_GOT32 => "ARM_GOT32",
        R_ARM_PLT32 => "ARM_PLT32",
        R_ARM_CALL => "ARM_CALL",
        R_ARM_JUMP24 => "ARM_JUMP24",
        R_ARM_THM_JUMP24 => "ARM_THM_JUMP24",
        R_ARM_BASE_ABS => "ARM_BASE_ABS",
        R_ARM_ALU_PCREL_7_0 => "ARM_ALU_PCREL_7_0",
        R_ARM_ALU_PCREL_15_8 => "ARM_ALU_PCREL_15_8",
        R_ARM_ALU_PCREL_23_15 => "ARM_ALU_PCREL_23_15",
        R_ARM_LDR_SBREL_11_0 => "ARM_LDR_SBREL_11_0",
        R_ARM_ALU_SBREL_19_12 => "ARM_ALU_SBREL_19_12",
        R_ARM_ALU_SBREL_27_20 => "ARM_ALU_SBREL_27_20",
        R_ARM_TARGET1 => "ARM_TARGET1",
        R_ARM_SBREL31 => "ARM_SBREL31",
        R_ARM_V4BX => "ARM_V4BX",
        R_ARM_TARGET2 => "ARM_TARGET2",
        R_ARM_PREL31 => "ARM_PREL31",
        R_ARM_MOVW_ABS_NC => "ARM_MOVW_ABS_NC",
        R_ARM_MOVT_ABS => "ARM_MOVT_ABS",
        R_ARM_MOVW_PREL_NC => "ARM_MOVW_PREL_NC",
        R_ARM_MOVT_PREL => "ARM_MOVT_PREL",
        R_ARM_THM_MOVW_ABS_NC => "ARM_THM_MOVW_ABS_NC",
        R_ARM_THM_MOVT_ABS => "ARM_THM_MOVT_ABS",
        R_ARM_THM_MOVW_PREL_NC => "ARM_THM_MOVW_PREL_NC",
        R_ARM_THM_MOVT_PREL => "ARM_THM_MOVT_PREL",
        R_ARM_THM_JUMP19 => "ARM_THM_JUMP19",
        R_ARM_THM_JUMP6 => "ARM_THM_JUMP6",
        R_ARM_THM_ALU_PREL_11_0 => "ARM_THM_ALU_PREL_11_0",
        R_ARM_THM_PC12 => "ARM_THM_PC12",
        R_ARM_ABS32_NOI => "ARM_ABS32_NOI",
        R_ARM_REL32_NOI => "ARM_REL32_NOI",
        R_ARM_ALU_PC_G0_NC => "ARM_ALU_PC_G0_NC",
        R_ARM_ALU_PC_G0 => "ARM_ALU_PC_G0",
        R_ARM_ALU_PC_G1_NC => "ARM_ALU_PC_G1_NC",
        R_ARM_ALU_PC_G1 => "ARM_ALU_PC_G1",
        R_ARM_ALU_PC_G2 => "ARM_ALU_PC_G2",
        R_ARM_LDR_PC_G1 => "ARM_LDR_PC_G1",
        R_ARM_LDR_PC_G2 => "ARM_LDR_PC_G2",
        R_ARM_LDRS_PC_G0 => "ARM_LDRS_PC_G0",
        R_ARM_LDRS_PC_G1 => "ARM_LDRS_PC_G1",
        R_ARM_LDRS_PC_G2 => "ARM_LDRS_PC_G2",
        R_ARM_LDC_PC_G0 => "ARM_LDC_PC_G0",
        R_ARM_LDC_PC_G1 => "ARM_LDC_PC_G1",
        R_ARM_LDC_PC_G2 => "ARM_LDC_PC_G2",
        R_ARM_ALU_SB_G0_NC => "ARM_ALU_SB_G0_NC",
        R_ARM_ALU_SB_G0 => "ARM_ALU_SB_G0",
        R_ARM_ALU_SB_G1_NC => "ARM_ALU_SB_G1_NC",
        R_ARM_ALU_SB_G1 => "ARM_ALU_SB_G1",
        R_ARM_ALU_SB_G2 => "ARM_ALU_SB_G2",
        R_ARM_LDR_SB_G0 => "ARM_LDR_SB_G0",
        R_ARM_LDR_SB_G1 => "ARM_LDR_SB_G1",
        R_ARM_LDR_SB_G2 => "ARM_LDR_SB_G2",
        R_ARM_LDRS_SB_G0 => "ARM_LDRS_SB_G0",
        R_ARM_LDRS_SB_G1 => "ARM_LDRS_SB_G1",
        R_ARM_LDRS_SB_G2 => "ARM_LDRS_SB_G2",
        R_ARM_LDC_SB_G0 => "ARM_LDC_SB_G0",
        R_ARM_LDC_SB_G1 => "ARM_LDC_SB_G1",
        R_ARM_LDC_SB_G2 => "ARM_LDC_SB_G2",
        R_ARM_MOVW_BREL_NC => "ARM_MOVW_BREL_NC",
        R_ARM_MOVT_BREL => "ARM_MOVT_BREL",
        R_ARM_MOVW_BREL => "ARM_MOVW_BREL",
        R_ARM_THM_MOVW_BREL_NC => "ARM_THM_MOVW_BREL_NC",
        R_ARM_THM_MOVT_BREL => "ARM_THM_MOVT_BREL",
        R_ARM_THM_MOVW_BREL => "ARM_THM_MOVW_BREL",
        R_ARM_TLS_GOTDESC => "ARM_TLS_GOTDESC",
        R_ARM_TLS_CALL => "ARM_TLS_CALL",
        R_ARM_TLS_DESCSEQ => "ARM_TLS_DESCSEQ",
        R_ARM_THM_TLS_CALL => "ARM_THM_TLS_CALL",
        R_ARM_PLT32_ABS => "ARM_PLT32_ABS",
        R_ARM_GOT_ABS => "ARM_GOT_ABS",
        R_ARM_GOT_PREL => "ARM_GOT_PREL",
        R_ARM_GOT_BREL12 => "ARM_GOT_BREL12",
        R_ARM_GOTOFF12 => "ARM_GOTOFF12",
        R_ARM_GOTRELAX => "ARM_GOTRELAX",
        R_ARM_GNU_VTENTRY => "ARM_GNU_VTENTRY",
        R_ARM_GNU_VTINHERIT => "ARM_GNU_VTINHERIT",
        R_ARM_THM_PC11 => "ARM_THM_PC11",
        R_ARM_THM_PC9 => "ARM_THM_PC9",
        R_ARM_TLS_GD32 => "ARM_TLS_GD32",
        R_ARM_TLS_LDM32 => "ARM_TLS_LDM32",
        R_ARM_TLS_LDO32 => "ARM_TLS_LDO32",
        R_ARM_TLS_IE32 => "ARM_TLS_IE32",
        R_ARM_TLS_LE32 => "ARM_TLS_LE32",
        R_ARM_TLS_LDO12 => "ARM_TLS_LDO12",
        R_ARM_TLS_LE12 => "ARM_TLS_LE12",
        R_ARM_TLS_IE12GP => "ARM_TLS_IE12GP",
        R_ARM_ME_TOO => "ARM_ME_TOO",
        R_ARM_THM_TLS_DESCSEQ16 => "ARM_THM_TLS_DESCSEQ16",
        R_ARM_THM_TLS_DESCSEQ32 => "ARM_THM_TLS_DESCSEQ32",
        R_ARM_THM_GOT_BREL12 => "ARM_THM_GOT_BREL12",
        R_ARM_IRELATIVE => "ARM_IRELATIVE",
        R_ARM_RXPC25 => "ARM_RXPC25",
        R_ARM_RSBREL32 => "ARM_RSBREL32",
        R_ARM_THM_RPC22 => "ARM_THM_RPC22",
        R_ARM_RREL32 => "ARM_RREL32",
        R_ARM_RABS22 => "ARM_RABS22",
        R_ARM_RPC24 => "ARM_RPC24",
        R_ARM_RBASE => "ARM_RBASE",
         _ => "R_UNKNOWN_ARM",
        }},
        // MIPS
        EM_MIPS | EM_MIPS_RS3_LE | EM_MIPS_X => { match typ {
        R_MIPS_NONE => "R_MIPS_NONE",
        R_MIPS_16 => "R_MIPS_16",
        R_MIPS_32 => "R_MIPS_32",
        R_MIPS_REL32 => "R_MIPS_REL32",
        R_MIPS_26 => "R_MIPS_26",
        R_MIPS_HI16 => "R_MIPS_HI16",
        R_MIPS_LO16 => "R_MIPS_LO16",
        R_MIPS_GPREL16 => "R_MIPS_GPREL16",
        R_MIPS_LITERAL => "R_MIPS_LITERAL",
        R_MIPS_GOT16 => "R_MIPS_GOT16",
        R_MIPS_PC16 => "R_MIPS_PC16",
        R_MIPS_CALL16 => "R_MIPS_CALL16",
        R_MIPS_GPREL32 => "R_MIPS_GPREL32",
        R_MIPS_SHIFT5 => "R_MIPS_SHIFT5",
        R_MIPS_SHIFT6 => "R_MIPS_SHIFT6",
        R_MIPS_64 => "R_MIPS_64",
        R_MIPS_GOT_DISP => "R_MIPS_GOT_DISP",
        R_MIPS_GOT_PAGE => "R_MIPS_GOT_PAGE",
        R_MIPS_GOT_OFST => "R_MIPS_GOT_OFST",
        R_MIPS_GOT_HI16 => "R_MIPS_GOT_HI16",
        R_MIPS_GOT_LO16 => "R_MIPS_GOT_LO16",
        R_MIPS_SUB => "R_MIPS_SUB",
        R_MIPS_INSERT_A => "R_MIPS_INSERT_A",
        R_MIPS_INSERT_B => "R_MIPS_INSERT_B",
        R_MIPS_DELETE => "R_MIPS_DELETE",
        R_MIPS_HIGHER => "R_MIPS_HIGHER",
        R_MIPS_HIGHEST => "R_MIPS_HIGHEST",
        R_MIPS_CALL_HI16 => "R_MIPS_CALL_HI16",
        R_MIPS_CALL_LO16 => "R_MIPS_CALL_LO16",
        R_MIPS_SCN_DISP => "R_MIPS_SCN_DISP",
        R_MIPS_REL16 => "R_MIPS_REL16",
        R_MIPS_ADD_IMMEDIATE => "R_MIPS_ADD_IMMEDIATE",
        R_MIPS_PJUMP => "R_MIPS_PJUMP",
        R_MIPS_RELGOT => "R_MIPS_RELGOT",
        R_MIPS_JALR => "R_MIPS_JALR",
        R_MIPS_TLS_DTPMOD32 => "R_MIPS_TLS_DTPMOD32",
        R_MIPS_TLS_DTPREL32 => "R_MIPS_TLS_DTPREL32",
        R_MIPS_TLS_DTPMOD64 => "R_MIPS_TLS_DTPMOD64",
        R_MIPS_TLS_DTPREL64 => "R_MIPS_TLS_DTPREL64",
        R_MIPS_TLS_GD => "R_MIPS_TLS_GD",
        R_MIPS_TLS_LDM => "R_MIPS_TLS_LDM",
        R_MIPS_TLS_DTPREL_HI16 => "R_MIPS_TLS_DTPREL_HI16",
        R_MIPS_TLS_DTPREL_LO16 => "R_MIPS_TLS_DTPREL_LO16",
        R_MIPS_TLS_GOTTPREL => "R_MIPS_TLS_GOTTPREL",
        R_MIPS_TLS_TPREL32 => "R_MIPS_TLS_TPREL32",
        R_MIPS_TLS_TPREL64 => "R_MIPS_TLS_TPREL64",
        R_MIPS_TLS_TPREL_HI16 => "R_MIPS_TLS_TPREL_HI16",
        R_MIPS_TLS_TPREL_LO16 => "R_MIPS_TLS_TPREL_LO16",
        R_MIPS_GLOB_DAT => "R_MIPS_GLOB_DAT",
        R_MIPS_COPY => "R_MIPS_COPY",
        R_MIPS_JUMP_SLOT => "R_MIPS_JUMP_SLOT",
        _ => "R_UNKNOWN_MIPS",
        }},
        // RISC-V
        EM_RISCV => { match typ {
        R_RISCV_NONE => "R_RISCV_NONE",
        R_RISCV_32 => "R_RISCV_32",
        R_RISCV_64 => "R_RISCV_64",
        R_RISCV_RELATIVE => "R_RISCV_RELATIVE",
        R_RISCV_COPY => "R_RISCV_COPY",
        R_RISCV_JUMP_SLOT => "R_RISCV_JUMP_SLOT",
        R_RISCV_TLS_DTPMOD32 => "R_RISCV_TLS_DTPMOD32",
        R_RISCV_TLS_DTPMOD64 => "R_RISCV_TLS_DTPMOD64",
        R_RISCV_TLS_DTPREL32 => "R_RISCV_TLS_DTPREL32",
        R_RISCV_TLS_DTPREL64 => "R_RISCV_TLS_DTPREL64",
        R_RISCV_TLS_TPREL32 => "R_RISCV_TLS_TPREL32",
        R_RISCV_TLS_TPREL64 => "R_RISCV_TLS_TPREL64",
        R_RISCV_BRANCH => "R_RISCV_BRANCH",
        R_RISCV_JAL => "R_RISCV_JAL",
        R_RISCV_CALL => "R_RISCV_CALL",
        R_RISCV_CALL_PLT => "R_RISCV_CALL_PLT",
        R_RISCV_GOT_HI20 => "R_RISCV_GOT_HI20",
        R_RISCV_TLS_GOT_HI20 => "R_RISCV_TLS_GOT_HI20",
        R_RISCV_TLS_GD_HI20 => "R_RISCV_TLS_GD_HI20",
        R_RISCV_PCREL_HI20 => "R_RISCV_PCREL_HI20",
        R_RISCV_PCREL_LO12_I => "R_RISCV_PCREL_LO12_I",
        R_RISCV_PCREL_LO12_S => "R_RISCV_PCREL_LO12_S",
        R_RISCV_HI20 => "R_RISCV_HI20",
        R_RISCV_LO12_I => "R_RISCV_LO12_I",
        R_RISCV_LO12_S => "R_RISCV_LO12_S",
        R_RISCV_TPREL_HI20 => "R_RISCV_TPREL_HI20",
        R_RISCV_TPREL_LO12_I => "R_RISCV_TPREL_LO12_I",
        R_RISCV_TPREL_LO12_S => "R_RISCV_TPREL_LO12_S",
        R_RISCV_TPREL_ADD => "R_RISCV_TPREL_ADD",
        R_RISCV_ADD8 => "R_RISCV_ADD8",
        R_RISCV_ADD16 => "R_RISCV_ADD16",
        R_RISCV_ADD32 => "R_RISCV_ADD32",
        R_RISCV_ADD64 => "R_RISCV_ADD64",
        R_RISCV_SUB8 => "R_RISCV_SUB8",
        R_RISCV_SUB16 => "R_RISCV_SUB16",
        R_RISCV_SUB32 => "R_RISCV_SUB32",
        R_RISCV_SUB64 => "R_RISCV_SUB64",
        R_RISCV_GNU_VTINHERIT => "R_RISCV_GNU_VTINHERIT",
        R_RISCV_GNU_VTENTRY => "R_RISCV_GNU_VTENTRY",
        R_RISCV_ALIGN => "R_RISCV_ALIGN",
        R_RISCV_RVC_BRANCH => "R_RISCV_RVC_BRANCH",
        R_RISCV_RVC_JUMP => "R_RISCV_RVC_JUMP",
        R_RISCV_RVC_LUI => "R_RISCV_RVC_LUI",
        R_RISCV_GPREL_I => "R_RISCV_GPREL_I",
        R_RISCV_GPREL_S => "R_RISCV_GPREL_S",
        R_RISCV_TPREL_I => "R_RISCV_TPREL_I",
        R_RISCV_TPREL_S => "R_RISCV_TPREL_S",
        R_RISCV_RELAX => "R_RISCV_RELAX",
        R_RISCV_SUB6 => "R_RISCV_SUB6",
        R_RISCV_SET6 => "R_RISCV_SET6",
        R_RISCV_SET8 => "R_RISCV_SET8",
        R_RISCV_SET16 => "R_RISCV_SET16",
        R_RISCV_SET32 => "R_RISCV_SET32",
        _ => "R_UNKNOWN_RISCV",
        }},
        _ => "R_UNKNOWN",
    }
}