LLVM: include/llvm/BinaryFormat/ELF.h Source File (original) (raw)
31
37
45
46
47static const char ElfMagic[] = {0x7f, 'E', 'L', 'F', '\0'};
48
49
50enum {
62};
63
87
88
89
113
114
115
116
117enum {
127};
128
129
131
132
133
134
135
136
137enum {
188 EM_ST9PLUS = 67,
198 EM_JAVELIN = 77,
213 EM_OPENRISC = 92,
214 EM_ARC_COMPACT = 93,
215
218 EM_TMM_GPP = 96,
228 EM_BLACKFIN = 106,
232 EM_UNICORE = 110,
233
241 EM_DSPIC30F = 118,
242
248
255 EM_TI_C6000 = 140,
256 EM_TI_C2000 = 141,
257 EM_TI_C5500 = 142,
258 EM_MMDSP_PLUS = 160,
261 EM_TRIMEDIA = 163,
265
267
273 EM_CRAYNV2 = 172,
276
277 EM_MCST_ELBRUS = 175,
280
289 EM_TILEPRO = 188,
290 EM_MICROBLAZE = 189,
294 EM_COREA_1ST = 193,
295 EM_COREA_2ND = 194,
301 EM_56800EX = 200,
328};
329
330
331enum {
335};
336
337
338enum {
342};
343
344
345enum {
376};
377
378
379enum {
380
381
387};
388
389
390enum {
393};
394
395#define ELF_RELOC(name, value) name = value,
396
397
398enum {
399#include "ELFRelocs/x86_64.def"
400};
401
402
403enum {
404#include "ELFRelocs/i386.def"
405};
406
407
408enum {
409#include "ELFRelocs/PowerPC.def"
410};
411
412
413enum {
414
415
416
417
419};
420
421
422enum {
425};
428 return ((1 << Val) >> 2) << 2;
429}
430
431
432enum {
433#include "ELFRelocs/PowerPC64.def"
434};
435
436
437enum {
438#include "ELFRelocs/AArch64.def"
439};
440
441
442enum {
443
445};
446
447
448enum : unsigned {
461};
462
463
464enum {
465#include "ELFRelocs/ARM.def"
466};
467
468
469enum : unsigned {
482};
483
484
485enum {
486#include "ELFRelocs/ARC.def"
487};
488
489
490enum : unsigned {
509
511
513
514};
515
516
517enum {
518#include "ELFRelocs/AVR.def"
519};
520
521
522enum : unsigned {
524 EF_MIPS_PIC = 0x00000002,
525 EF_MIPS_CPIC = 0x00000004,
528
529 EF_MIPS_FP64 = 0x00000200,
530
532
533
534 EF_MIPS_ABI_O32 = 0x00001000,
535 EF_MIPS_ABI_O64 = 0x00002000,
538 EF_MIPS_ABI = 0x0000f000,
539
540
560 EF_MIPS_MACH = 0x00ff0000,
561
562
567
568
574 EF_MIPS_ARCH_32 = 0x50000000,
575 EF_MIPS_ARCH_64 = 0x60000000,
580 EF_MIPS_ARCH = 0xf0000000
581};
582
583
584enum {
585 SHN_MIPS_ACOMMON = 0xff00,
590};
591
592
593enum {
594#include "ELFRelocs/Mips.def"
595};
596
597
598enum {
600 STO_MIPS_PLT = 0x08,
601 STO_MIPS_PIC = 0x20,
604};
605
606
607enum {
617 ODK_GP_GROUP = 9,
620};
621
622
623enum {
624
626
652
653
655
656
685
687};
688
689
690enum {
696};
697
698
699enum {
700#include "ELFRelocs/Hexagon.def"
701};
702
703
704enum {
705#include "ELFRelocs/Lanai.def"
706};
707
708
709enum : unsigned {
718};
719
720
721enum {
722#include "ELFRelocs/RISCV.def"
723#define ELF_RISCV_NONSTANDARD_RELOC(_vendor, name, value) name = value,
724#include "ELFRelocs/RISCV_nonstandard.def"
725#undef ELF_RISCV_NONSTANDARD_RELOC
726};
727
728enum {
729
730
732};
733
734
735enum {
736#include "ELFRelocs/SystemZ.def"
737};
738
739
740enum : unsigned {
741
742
743
744
745
746
752
753
758};
759
760
761enum {
762#include "ELFRelocs/Sparc.def"
763};
764
765
766enum : unsigned {
767
769
770
772
773
774
775
780
784
790
795
796
799
800
803
804
805
866
867
868
871
872
873
874
875
877
878
879
880
882
883
884
885
886
888
889
890
891
893
894
895
896
898
900
902
904
906
907
908
909
911
913
915
917
919
920
925};
926
927
928enum {
929#include "ELFRelocs/AMDGPU.def"
930};
931
932
933enum : unsigned {
934
936
937
939
940
942
943
971
972
974
976
978
980
982
983
985
986
988};
989
990
991enum {
992#include "ELFRelocs/BPF.def"
993};
994
995
996enum {
997#include "ELFRelocs/M68k.def"
998};
999
1000
1001enum : unsigned {
1025};
1026
1027
1028enum {
1029#include "ELFRelocs/MSP430.def"
1030};
1031
1032
1033enum {
1034#include "ELFRelocs/VE.def"
1035};
1036
1037
1038enum : unsigned {
1053};
1054
1055
1056enum {
1057#include "ELFRelocs/CSKY.def"
1058};
1059
1060
1061enum : unsigned {
1062
1063
1064
1065
1066
1071
1072
1076};
1077
1078
1079enum {
1080#include "ELFRelocs/LoongArch.def"
1081};
1082
1083
1084enum : unsigned {
1085
1087
1091};
1092
1093
1094enum {
1095#include "ELFRelocs/Xtensa.def"
1096};
1097
1098#undef ELF_RELOC
1099
1100
1113
1114
1127
1129
1130
1131enum {
1134 SHN_LOPROC = 0xff00,
1135 SHN_HIPROC = 0xff1f,
1139 SHN_COMMON = 0xfff2,
1140 SHN_XINDEX = 0xffff,
1142};
1143
1144
1145enum : unsigned {
1154 SHT_NOBITS = 8,
1163
1164
1166
1167
1170
1171
1177
1179 0x6fff4c04,
1183
1191
1192
1201 SHT_LOPROC = 0x70000000,
1202
1203
1205
1207
1211
1213
1214
1216
1217
1221
1223
1228
1230
1232
1234
1236
1237 SHT_HIPROC = 0x7fffffff,
1238 SHT_LOUSER = 0x80000000,
1239 SHT_HIUSER = 0xffffffff
1240};
1241
1242
1243enum : unsigned {
1244
1246
1247
1249
1250
1252
1253
1255
1256
1258
1259
1261
1262
1264
1265
1266
1268
1269
1271
1272
1274
1275
1277
1278
1280
1281
1283
1284
1285
1287
1288
1290
1291
1293
1294
1295
1296
1298
1299
1300
1301
1303
1304
1305
1306
1307
1308
1309
1310
1312
1313
1314
1316
1317
1318
1320
1321
1323
1324
1326
1327
1329
1330
1332
1333
1335
1336
1338
1339
1341
1342
1344
1345
1347};
1348
1349
1350enum : unsigned {
1354};
1355
1356
1375
1376
1395
1396
1397enum {
1400};
1401
1402
1403enum {
1405 STB_GLOBAL = 1,
1410 STB_LOPROC = 13,
1411 STB_HIPROC = 15
1412};
1413
1414
1415enum {
1417 STT_OBJECT = 1,
1426 STT_LOPROC = 13,
1427 STT_HIPROC = 15,
1428
1429
1431};
1432
1433enum {
1434 STV_DEFAULT = 0,
1437 STV_PROTECTED = 3
1438};
1439
1440
1442
1443
1444enum {
1449};
1450
1451
1455
1456
1457
1459 unsigned char getType() const { return (unsigned char)(r_info & 0x0ff); }
1463 r_info = (s << 8) + t;
1464 }
1465};
1466
1467
1472
1473
1474
1476 unsigned char getType() const { return (unsigned char)(r_info & 0x0ff); }
1480 r_info = (s << 8) + t;
1481 }
1482};
1483
1484
1486
1487
1502
1503
1519
1520
1522 std::conditional_t<Is64, uint64_t, uint32_t> r_offset;
1525 std::conditional_t<Is64, int64_t, int32_t> r_addend;
1526};
1527
1528
1530
1531
1542
1543
1554
1555
1556enum {
1569
1570
1571
1575
1576 PT_GNU_STACK = 0x6474e551,
1580
1587
1588
1589 PT_ARM_ARCHEXT = 0x70000000,
1590
1593
1595
1596
1601
1602
1604};
1605
1606
1607enum : unsigned {
1612 PF_MASKPROC = 0xf0000000
1613};
1614
1615
1623
1624
1632
1633
1634enum {
1635#define DYNAMIC_TAG(name, value) DT_##name = value,
1636#include "DynamicTags.def"
1637#undef DYNAMIC_TAG
1638};
1639
1640
1641enum {
1643 DF_SYMBOLIC = 0x02,
1644 DF_TEXTREL = 0x04,
1648
1649
1650enum {
1652 DF_1_GLOBAL = 0x00000002,
1653 DF_1_GROUP = 0x00000004,
1654 DF_1_NODELETE = 0x00000008,
1655 DF_1_LOADFLTR = 0x00000010,
1657 DF_1_NOOPEN = 0x00000040,
1664 DF_1_CONFALT = 0x00002000,
1672 DF_1_EDITED = 0x00200000,
1678};
1679
1680
1684 RHF_NOTPOT = 0x00000002,
1686 RHF_NO_MOVE = 0x00000008,
1689
1690
1693
1694
1701
1703};
1704
1705
1707
1708
1710
1711
1712enum {
1713 VER_NDX_LOCAL = 0,
1717};
1718
1719
1721
1722
1723
1724
1725enum : unsigned {
1730};
1731
1732
1733enum : unsigned {
1745
1761
1765
1779
1792
1796};
1797
1798
1799enum {
1801};
1802
1803
1804enum {
1811};
1812
1813
1814enum {
1818};
1819
1820
1821enum {
1822
1823
1824
1825
1826
1827
1832
1833
1836};
1837
1838
1839enum : unsigned {
1846
1850
1854};
1855
1856
1857enum : unsigned {
1861};
1862
1863
1864enum : unsigned {
1868};
1869
1870
1871enum : unsigned {
1886};
1887
1888
1889enum : unsigned {
1892
1903
1908};
1909
1910
1911enum : unsigned {
1915};
1916
1917
1918enum {
1923};
1924
1925
1926enum {
1933};
1934
1935
1936enum {
1947};
1948
1949
1950enum {
1954};
1955
1956
1957enum {
1964};
1965
1966
1967enum {
1968 SHN_AMDGPU_LDS = 0xff00,
1969};
1970
1971
1972enum {
1976
1980};
1981
1982
1983enum {
1984
1986};
1987
1988
1989enum : unsigned {
1993};
1994
1995enum {
2002};
2003
2005
2006
2007enum {
2012};
2013
2014
2020
2021
2028
2029
2035
2036
2042
2043
2044enum {
2051};
2052
2054
2055
2057
2058
2060
2061
2063
2064
2066
2067
2068
2070
2071}