summaryrefslogtreecommitdiff
path: root/usr/src/lib/libdwarf/common/dwarf_elf_defines.h
blob: 490abea74ad88f599971a2d98db6699277adb0c6 (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
/* Copyright (c) 2019, David Anderson
All rights reserved.

Redistribution and use in source and binary forms, with
or without modification, are permitted provided that the
following conditions are met:

    Redistributions of source code must retain the above
    copyright notice, this list of conditions and the following
    disclaimer.

    Redistributions in binary form must reproduce the above
    copyright notice, this list of conditions and the following
    disclaimer in the documentation and/or other materials
    provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/
#ifndef DWARF_ELF_DEFINES_H
#define DWARF_ELF_DEFINES_H

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/*  Use the system headers if they are available. */
#ifdef HAVE_ELF_H
#include <elf.h>
#endif /* HAVE_ELF_H */

/*  Relocation definitions are in sys/elf_{mach}.h on Solaris.  */
#ifdef HAVE_LIBELF_H
#include <libelf.h>
#else
#ifdef HAVE_LIBELF_LIBELF_H
#include <libelf/libelf.h>
#endif /* HAVE_LIBELF_LIBELF_H */
#endif /* HAVE_LIBELF_H */

/* Standard Elf section types. */
#ifndef SHT_NULL
#define SHT_NULL 0
#endif
#ifndef SHT_PROGBITS
#define SHT_PROGBITS 1
#endif
#ifndef SHT_SYMTAB
#define SHT_SYMTAB 2
#endif
#ifndef SHT_STRTAB
#define SHT_STRTAB 3
#endif
#ifndef SHT_RELA
#define SHT_RELA 4
#endif
#ifndef SHT_REL
#define SHT_REL 9
#endif

#ifndef DW_GROUPNUMBER_BASE
#define DW_GROUPNUMBER_BASE 1
#endif
#ifndef DW_GROUPNUMBER_DWO
#define DW_GROUPNUMBER_DWO  2
#endif

#ifndef SHF_GROUP
#define SHF_GROUP  (1 << 9)
#endif /* SHF_GROUP */

#ifndef STN_UNDEF
#define STN_UNDEF  0
#endif /* STN_UNDEF */

#ifndef SHT_HASH
#define SHT_HASH 5
#endif
#ifndef SHT_DYNAMIC
#define SHT_DYNAMIC 6
#endif
#ifndef SHT_NOTE
#define SHT_NOTE 7
#endif
#ifndef SHT_NOBITS
#define SHT_NOBITS 8
#endif
#ifndef SHT_REL
#define SHT_REL  9
#endif
#ifndef SHT_SHLIB
#define SHT_SHLIB 10
#endif
#ifndef SHT_DYNSYM
#define SHT_DYNSYM 11
#endif
#ifndef SHT_GROUP
#define SHT_GROUP  17
#endif /* SHT_GROUP */

/* Symbol Types, Elf standard. */
#define STT_NOTYPE  0
#define STT_OBJECT  1
#define STT_FUNC    2
#define STT_SECTION 3
#define STT_FILE    4

#ifndef PT_NULL
#define PT_NULL 0
#endif
#ifndef PT_LOAD
#define PT_LOAD 1
#endif
#ifndef PT_DYNAMIC
#define PT_DYNAMIC 2
#endif
#ifndef PT_INTERP
#define PT_INTERP 3
#endif
#ifndef PT_NOTE
#define PT_NOTE 4
#endif
#ifndef PT_SHLIB
#define PT_SHLIB 5
#endif
#ifndef PT_PHDR
#define PT_PHDR 6
#endif
#ifndef PT_LOPROC
#define PT_LOPROC 0x70000000
#endif
#ifndef PT_HIPROC
#define PT_HIPROC 0x7fffffff
#endif

#ifndef PF_X
#define PF_X            (1 << 0)
#endif
#ifndef PF_W
#define PF_W            (1 << 1)
#endif
#ifndef PF_R
#define PF_R            (1 << 2)
#endif
#ifndef PF_MASKOS
#define PF_MASKOS       0x0ff00000
#endif
#ifndef PF_MASKPROC
#define PF_MASKPROC     0xf0000000
#endif


#ifndef ET_NONE
#define ET_NONE          0
#endif
#ifndef ET_REL
#define ET_REL           1
#endif
#ifndef ET_EXEC
#define ET_EXEC          2
#endif
#ifndef ET_DYN
#define ET_DYN           3
#endif
#ifndef ET_CORE
#define ET_CORE          4
#endif
#ifndef ET_NUM
#define ET_NUM           5
#endif
#ifndef ET_LOOS
#define ET_LOOS          0xfe00
#endif
#ifndef ET_HIOS
#define ET_HIOS          0xfeff
#endif
#ifndef ET_LOPROC
#define ET_LOPROC        0xff00
#endif
#ifndef ET_HIPROC
#define ET_HIPROC        0xffff
#endif


#ifndef EM_NONE
#define EM_NONE          0
#endif
#ifndef EM_M32
#define EM_M32           1
#endif
#ifndef EM_SPARC
#define EM_SPARC         2
#endif
#ifndef EM_386
#define EM_386           3
#endif
#ifndef EM_68K
#define EM_68K           4
#endif
#ifndef EM_88K
#define EM_88K           5
#endif
#ifndef EM_IAMCU
#define EM_IAMCU         6
#endif
#ifndef EM_860
#define EM_860           7
#endif
#ifndef EM_MIPS
#define EM_MIPS          8
#endif
#ifndef EM_S370
#define EM_S370          9
#endif
#ifndef EM_MIPS_RS3_LE
#define EM_MIPS_RS3_LE   10
#endif
#ifndef EM_PARISC
#define EM_PARISC        15
#endif
#ifndef EM_VPP500
#define EM_VPP500        17
#endif
#ifndef EM_SPARC32PLUS
#define EM_SPARC32PLUS   18
#endif
#ifndef EM_960
#define EM_960           19
#endif
#ifndef EM_PPC
#define EM_PPC           20
#endif
#ifndef EM_PPC64
#define EM_PPC64         21
#endif
#ifndef EM_S390
#define EM_S390          22
#endif
#ifndef EM_SPU
#define EM_SPU           23
#endif
#ifndef EM_V800
#define EM_V800          36
#endif
#ifndef EM_FR20
#define EM_FR20          37
#endif
#ifndef EM_RH32
#define EM_RH32          38
#endif
#ifndef EM_RCE
#define EM_RCE           39
#endif
#ifndef EM_ARM
#define EM_ARM           40
#endif
#ifndef EM_FAKE_ALPHA
#define EM_FAKE_ALPHA    41
#endif
#ifndef EM_SH
#define EM_SH            42
#endif
#ifndef EM_SPARCV9
#define EM_SPARCV9       43
#endif
#ifndef EM_TRICORE
#define EM_TRICORE       44
#endif
#ifndef EM_ARC
#define EM_ARC           45
#endif
#ifndef EM_H8_300
#define EM_H8_300        46
#endif
#ifndef EM_H8_300H
#define EM_H8_300H       47
#endif
#ifndef EM_H8S
#define EM_H8S           48
#endif
#ifndef EM_H8_500
#define EM_H8_500        49
#endif
#ifndef EM_IA_64
#define EM_IA_64         50
#endif
#ifndef EM_MIPS_X
#define EM_MIPS_X        51
#endif
#ifndef EM_COLDFIRE
#define EM_COLDFIRE      52
#endif
#ifndef EM_68HC12
#define EM_68HC12        53
#endif
#ifndef EM_MMA
#define EM_MMA           54
#endif
#ifndef EM_PCP
#define EM_PCP           55
#endif
#ifndef EM_NCPU
#define EM_NCPU          56
#endif
#ifndef EM_NDR1
#define EM_NDR1          57
#endif
#ifndef EM_STARCORE
#define EM_STARCORE      58
#endif
#ifndef EM_ME16
#define EM_ME16          59
#endif
#ifndef EM_ST100
#define EM_ST100         60
#endif
#ifndef EM_TINYJ
#define EM_TINYJ         61
#endif
#ifndef EM_X86_64
#define EM_X86_64        62
#endif
#ifndef EM_PDSP
#define EM_PDSP          63
#endif
#ifndef EM_PDP10
#define EM_PDP10         64
#endif
#ifndef EM_PDP11
#define EM_PDP11         65
#endif
#ifndef EM_FX66
#define EM_FX66          66
#endif
#ifndef EM_ST9PLUS
#define EM_ST9PLUS       67
#endif
#ifndef EM_ST7
#define EM_ST7           68
#endif
#ifndef EM_68HC16
#define EM_68HC16        69
#endif
#ifndef EM_68HC11
#define EM_68HC11        70
#endif
#ifndef EM_68HC08
#define EM_68HC08        71
#endif
#ifndef EM_68HC05
#define EM_68HC05        72
#endif
#ifndef EM_SVX
#define EM_SVX           73
#endif
#ifndef EM_ST19
#define EM_ST19          74
#endif
#ifndef EM_VAX
#define EM_VAX           75
#endif
#ifndef EM_CRIS
#define EM_CRIS          76
#endif
#ifndef EM_JAVELIN
#define EM_JAVELIN       77
#endif
#ifndef EM_FIREPATH
#define EM_FIREPATH      78
#endif
#ifndef EM_ZSP
#define EM_ZSP           79
#endif
#ifndef EM_MMIX
#define EM_MMIX          80
#endif
#ifndef EM_HUANY
#define EM_HUANY         81
#endif
#ifndef EM_PRISM
#define EM_PRISM         82
#endif
#ifndef EM_AVR
#define EM_AVR           83
#endif
#ifndef EM_FR30
#define EM_FR30          84
#endif
#ifndef EM_D10V
#define EM_D10V          85
#endif
#ifndef EM_D30V
#define EM_D30V          86
#endif
#ifndef EM_V850
#define EM_V850          87
#endif
#ifndef EM_M32R
#define EM_M32R          88
#endif
#ifndef EM_MN10300
#define EM_MN10300       89
#endif
#ifndef EM_MN10200
#define EM_MN10200       90
#endif
#ifndef EM_PJ
#define EM_PJ            91
#endif
#ifndef EM_OPENRISC
#define EM_OPENRISC      92
#endif
#ifndef EM_ARC_COMPACT
#define EM_ARC_COMPACT   93
#endif
#ifndef EM_XTENSA
#define EM_XTENSA        94
#endif
#ifndef EM_VIDEOCORE
#define EM_VIDEOCORE     95
#endif
#ifndef EM_TMM_GPP
#define EM_TMM_GPP       96
#endif
#ifndef EM_NS32K
#define EM_NS32K         97
#endif
#ifndef EM_TPC
#define EM_TPC           98
#endif
#ifndef EM_SNP1K
#define EM_SNP1K         99
#endif
#ifndef EM_ST200
#define EM_ST200         100
#endif
#ifndef EM_IP2K
#define EM_IP2K          101
#endif
#ifndef EM_MAX
#define EM_MAX           102
#endif
#ifndef EM_CR
#define EM_CR            103
#endif
#ifndef EM_F2MC16
#define EM_F2MC16        104
#endif
#ifndef EM_MSP430
#define EM_MSP430        105
#endif
#ifndef EM_BLACKFIN
#define EM_BLACKFIN      106
#endif
#ifndef EM_SE_C33
#define EM_SE_C33        107
#endif
#ifndef EM_SEP
#define EM_SEP           108
#endif
#ifndef EM_ARCA
#define EM_ARCA          109
#endif
#ifndef EM_UNICORE
#define EM_UNICORE       110
#endif
#ifndef EM_EXCESS
#define EM_EXCESS        111
#endif
#ifndef EM_DXP
#define EM_DXP           112
#endif
#ifndef EM_ALTERA_NIOS2
#define EM_ALTERA_NIOS2  113
#endif
#ifndef EM_CRX
#define EM_CRX           114
#endif
#ifndef EM_XGATE
#define EM_XGATE         115
#endif
#ifndef EM_C166
#define EM_C166          116
#endif
#ifndef EM_M16C
#define EM_M16C          117
#endif
#ifndef EM_DSPIC30F
#define EM_DSPIC30F      118
#endif
#ifndef EM_CE
#define EM_CE            119
#endif
#ifndef EM_M32C
#define EM_M32C          120
#endif
#ifndef EM_TSK3000
#define EM_TSK3000       131
#endif
#ifndef EM_RS08
#define EM_RS08          132
#endif
#ifndef EM_SHARC
#define EM_SHARC         133
#endif
#ifndef EM_ECOG2
#define EM_ECOG2         134
#endif
#ifndef EM_SCORE7
#define EM_SCORE7        135
#endif
#ifndef EM_DSP24
#define EM_DSP24         136
#endif
#ifndef EM_VIDEOCORE3
#define EM_VIDEOCORE3    137
#endif
#ifndef EM_LATTICEMICO32
#define EM_LATTICEMICO32 138
#endif
#ifndef EM_SE_C17
#define EM_SE_C17        139
#endif
#ifndef EM_TI_C6000
#define EM_TI_C6000      140
#endif
#ifndef EM_TI_C2000
#define EM_TI_C2000      141
#endif
#ifndef EM_TI_C5500
#define EM_TI_C5500      142
#endif
#ifndef EM_TI_ARP32
#define EM_TI_ARP32      143
#endif
#ifndef EM_TI_PRU
#define EM_TI_PRU        144
#endif
#ifndef EM_MMDSP_PLUS
#define EM_MMDSP_PLUS    160
#endif
#ifndef EM_CYPRESS_M8C
#define EM_CYPRESS_M8C   161
#endif
#ifndef EM_R32C
#define EM_R32C          162
#endif
#ifndef EM_TRIMEDIA
#define EM_TRIMEDIA      163
#endif
#ifndef EM_QDSP6
#define EM_QDSP6         164
#endif
#ifndef EM_QUALCOMM_DSP6
#define EM_QUALCOMM_DSP6 164
#endif
#ifndef EM_8051
#define EM_8051          165
#endif
#ifndef EM_STXP7X
#define EM_STXP7X        166
#endif
#ifndef EM_NDS32
#define EM_NDS32         167
#endif
#ifndef EM_ECOG1X
#define EM_ECOG1X        168
#endif
#ifndef EM_MAXQ30
#define EM_MAXQ30        169
#endif
#ifndef EM_XIMO16
#define EM_XIMO16        170
#endif
#ifndef EM_MANIK
#define EM_MANIK         171
#endif
#ifndef EM_CRAYNV2
#define EM_CRAYNV2       172
#endif
#ifndef EM_RX
#define EM_RX            173
#endif
#ifndef EM_METAG
#define EM_METAG         174
#endif
#ifndef EM_MCST_ELBRUS
#define EM_MCST_ELBRUS   175
#endif
#ifndef EM_ECOG16
#define EM_ECOG16        176
#endif
#ifndef EM_CR16
#define EM_CR16          177
#endif
#ifndef EM_ETPU
#define EM_ETPU          178
#endif
#ifndef EM_SLE9X
#define EM_SLE9X         179
#endif
#ifndef EM_L10M
#define EM_L10M          180
#endif
#ifndef EM_K10M
#define EM_K10M          181
#endif
#ifndef EM_AARCH64
#define EM_AARCH64       183
#endif
#ifndef EM_AVR32
#define EM_AVR32         185
#endif
#ifndef EM_STM8
#define EM_STM8          186
#endif
#ifndef EM_TILE64
#define EM_TILE64        187
#endif
#ifndef EM_TILEPRO
#define EM_TILEPRO       188
#endif
#ifndef EM_MICROBLAZE
#define EM_MICROBLAZE    189
#endif
#ifndef EM_CUDA
#define EM_CUDA          190
#endif
#ifndef EM_TILEGX
#define EM_TILEGX        191
#endif
#ifndef EM_CLOUDSHIELD
#define EM_CLOUDSHIELD   192
#endif
#ifndef EM_COREA_1ST
#define EM_COREA_1ST     193
#endif
#ifndef EM_COREA_2ND
#define EM_COREA_2ND     194
#endif
#ifndef EM_ARC_COMPACT2
#define EM_ARC_COMPACT2  195
#endif
#ifndef EM_OPEN8
#define EM_OPEN8         196
#endif
#ifndef EM_RL78
#define EM_RL78          197
#endif
#ifndef EM_VIDEOCORE5
#define EM_VIDEOCORE5    198
#endif
#ifndef EM_78KOR
#define EM_78KOR         199
#endif
#ifndef EM_56800EX
#define EM_56800EX       200
#endif
#ifndef EM_BA1
#define EM_BA1           201
#endif
#ifndef EM_BA2
#define EM_BA2           202
#endif
#ifndef EM_XCORE
#define EM_XCORE         203
#endif
#ifndef EM_MCHP_PIC
#define EM_MCHP_PIC      204
#endif
#ifndef EM_KM32
#define EM_KM32          210
#endif
#ifndef EM_KMX32
#define EM_KMX32         211
#endif
#ifndef EM_EMX16
#define EM_EMX16         212
#endif
#ifndef EM_EMX8
#define EM_EMX8          213
#endif
#ifndef EM_KVARC
#define EM_KVARC         214
#endif
#ifndef EM_CDP
#define EM_CDP           215
#endif
#ifndef EM_COGE
#define EM_COGE          216
#endif
#ifndef EM_COOL
#define EM_COOL          217
#endif
#ifndef EM_NORC
#define EM_NORC          218
#endif
#ifndef EM_CSR_KALIMBA
#define EM_CSR_KALIMBA   219
#endif
#ifndef EM_Z80
#define EM_Z80           220
#endif
#ifndef EM_VISIUM
#define EM_VISIUM        221
#endif
#ifndef EM_FT32
#define EM_FT32          222
#endif
#ifndef EM_MOXIE
#define EM_MOXIE         223
#endif
#ifndef EM_AMDGPU
#define EM_AMDGPU        224
#endif
#ifndef EM_RISCV
#define EM_RISCV         243
#endif
#ifndef EM_BPF
#define EM_BPF           247
#endif

/* Standard Elf dynamic tags. */
#ifndef DT_NULL
#define DT_NULL 0
#endif
#ifndef DT_NEEDED
#define DT_NEEDED 1
#endif
#ifndef DT_PLTRELSZ
#define DT_PLTRELSZ 2
#endif
#ifndef DT_PLTGOT
#define DT_PLTGOT 3
#endif
#ifndef DT_HASH
#define DT_HASH 4
#endif
#ifndef DT_STRTAB
#define DT_STRTAB 5
#endif
#ifndef DT_SYMTAB
#define DT_SYMTAB 6
#endif
#ifndef DT_RELA
#define DT_RELA 7
#endif
#ifndef DT_REL
#define DT_REL 17
#endif
#ifndef DT_RELASZ
#define DT_RELASZ 8
#endif
#ifndef DT_RELAENT
#define DT_RELAENT 9
#endif
#ifndef DT_STRSZ
#define DT_STRSZ  10
#endif

#ifndef DT_SYMENT
#define DT_SYMENT 11
#endif

#ifndef DT_INIT
#define DT_INIT 12
#endif

#ifndef DT_FINI
#define DT_FINI 13
#endif

#ifndef DT_SONAME
#define DT_SONAME 14
#endif

#ifndef DT_RPATH
#define DT_RPATH 15
#endif

#ifndef DT_SYMBOLIC
#define DT_SYMBOLIC 16
#endif

#ifndef DT_REL
#define DT_REL 17
#endif
#ifndef DT_RELSZ
#define DT_RELSZ 18
#endif

#ifndef DT_RELENT
#define DT_RELENT 19
#endif

#ifndef DT_PLTREL
#define DT_PLTREL 20
#endif

#ifndef DT_DEBUG
#define DT_DEBUG 21
#endif

#ifndef DT_TEXTREL
#define DT_TEXTREL 22
#endif

#ifndef DT_JMPREL
#define DT_JMPREL 23
#endif

#ifndef SHN_UNDEF
#define SHN_UNDEF 0
#endif
#ifndef SHN_LORESERVE
#define SHN_LORESERVE 0xff00
#endif
#ifndef SHN_LOPROC
#define SHN_LOPROC 0xff00
#endif
#ifndef SHN_HIPROC
#define SHN_HIPROC 0xff1f
#endif
#ifndef SHN_ABS
#define SHN_ABS 0xfff1
#endif
#ifndef SHN_COMMON
#define SHN_COMMON 0xfff2
#endif
#ifndef SHN_HIRESERVE
#define SHN_HIRESERVE 0xffff
#endif

#ifndef EV_CURRENT
#define EV_CURRENT       1
#endif
#ifndef EV_NONE
#define EV_NONE          0
#endif

#ifndef EI_MAG0
#define EI_MAG0          0
#endif
#ifndef EI_MAG1
#define EI_MAG1          1
#endif
#ifndef EI_MAG2
#define EI_MAG2          2
#endif
#ifndef EI_MAG3
#define EI_MAG3          3
#endif
#ifndef EI_CLASS
#define EI_CLASS         4
#endif
#ifndef EI_DATA
#define EI_DATA          5
#endif
#ifndef EI_VERSION
#define EI_VERSION       6
#endif
#ifndef EI_PAD
#define EI_PAD           7
#endif
#ifndef EI_OSABI
#define EI_OSABI         7
#endif
#ifndef EI_NIDENT
#define EI_NIDENT        16
#endif
#ifndef EI_ABIVERSION
#define EI_ABIVERSION       8
#endif

#ifndef ELFMAG0
#define ELFMAG0          0x7f
#endif
#ifndef ELFMAG1
#define ELFMAG1          'E'
#endif
#ifndef ELFMAG2
#define ELFMAG2          'L'
#endif
#ifndef ELFMAG3
#define ELFMAG3          'F'
#endif
#ifndef ELFCLASSNONE
#define ELFCLASSNONE     0
#endif
#ifndef ELFCLASS32
#define ELFCLASS32       1
#endif
#ifndef ELFCLASS64
#define ELFCLASS64       2
#endif
#ifndef ELFDATANONE
#define ELFDATANONE      0
#endif
#ifndef ELFDATA2LSB
#define ELFDATA2LSB      1
#endif
#ifndef ELFDATA2MSB
#define ELFDATA2MSB      2
#endif

#ifndef ELFOSABI_NONE
#define ELFOSABI_NONE       0
#endif
#ifndef ELFOSABI_SYSV
#define ELFOSABI_SYSV       0
#endif
#ifndef ELFOSABI_HPUX
#define ELFOSABI_HPUX       1
#endif
#ifndef ELFOSABI_NETBSD
#define ELFOSABI_NETBSD     2
#endif
#ifndef ELFOSABI_GNU
#define ELFOSABI_GNU        3
#endif
#ifndef ELFOSABI_LINUX
#define ELFOSABI_LINUX      ELFOSABI_GNU
#endif
#ifndef ELFOSABI_SOLARIS
#define ELFOSABI_SOLARIS    6
#endif
#ifndef ELFOSABI_AIX
#define ELFOSABI_AIX        7
#endif
#ifndef ELFOSABI_IRIX
#define ELFOSABI_IRIX       8
#endif
#ifndef ELFOSABI_FREEBSD
#define ELFOSABI_FREEBSD    9
#endif
#ifndef ELFOSABI_TRU64
#define ELFOSABI_TRU64      10
#endif
#ifndef ELFOSABI_MODESTO
#define ELFOSABI_MODESTO    11
#endif
#ifndef ELFOSABI_OPENBSD
#define ELFOSABI_OPENBSD    12
#endif
#ifndef ELFOSABI_ARM_AEABI
#define ELFOSABI_ARM_AEABI  64
#endif
#ifndef ELFOSABI_ARM
#define ELFOSABI_ARM        97
#endif
#ifndef ELFOSABI_STANDALONE
#define ELFOSABI_STANDALONE 255
#endif


/* for the producer code. */
#ifndef R_MIPS_NONE
#define R_MIPS_NONE 0
#endif
#ifndef R_QUALCOMM_REL32
#define R_QUALCOMM_REL32   6
#endif
/*  For Freebsd: */
#ifndef R_PPC64_ADDR32
#define R_PPC64_ADDR32     1
#endif
#ifndef R_PPC64_DTPREL32
#define R_PPC64_DTPREL32 110
#endif
#ifndef R_PPC64_DTPREL64
#define R_PPC64_DTPREL64 78
#endif
#ifndef R_PPC_DTPREL32
#define R_PPC_DTPREL32   78
#endif
/* The following two probably useless. */
#ifndef R_X86_64_PC32_BND
#define R_X86_64_PC32_BND 39
#endif
#ifndef R_X86_64_PLT32_BND
#define R_X86_64_PLT32_BND  40
#endif

#ifndef R_386_32
#define R_386_32                               1
#endif /* R_386_32 */
#ifndef R_386_PC32
#define R_386_PC32                             2
#endif /* R_386_PC32 */
#ifndef R_386_TLS_DTPOFF32
#define R_386_TLS_DTPOFF32                     36
#endif /* R_386_TLS_DTPOFF32 */
#ifndef R_386_TLS_LDO_32
#define R_386_TLS_LDO_32                       32
#endif /* R_386_TLS_LDO_32 */
#ifndef R_390_32
#define R_390_32                               4
#endif /* R_390_32 */
#ifndef R_390_64
#define R_390_64                               22
#endif /* R_390_64 */
#ifndef R_390_TLS_LDO32
#define R_390_TLS_LDO32                        52
#endif /* R_390_TLS_LDO32 */
#ifndef R_390_TLS_LDO64
#define R_390_TLS_LDO64                        53
#endif /* R_390_TLS_LDO64 */
#ifndef R_AARCH64_ABS32
#define R_AARCH64_ABS32                        258
#endif /* R_AARCH64_ABS32 */
#ifndef R_AARCH64_ABS64
#define R_AARCH64_ABS64                        257
#endif /* R_AARCH64_ABS64 */
#ifndef R_ARM_ABS32
#define R_ARM_ABS32                            2
#endif /* R_ARM_ABS32 */
#ifndef R_ARM_TLS_LDO32
#define R_ARM_TLS_LDO32                        106
#endif /* R_ARM_TLS_LDO32 */
#ifndef R_IA64_DIR32LSB
#define R_IA64_DIR32LSB                        0x25
#endif /* R_IA64_DIR32LSB */
#ifndef R_IA64_DIR64LSB
#define R_IA64_DIR64LSB                        0x27
#endif /* R_IA64_DIR64LSB */
#ifndef R_IA64_DTPREL32LSB
#define R_IA64_DTPREL32LSB                     0xb5
#endif /* R_IA64_DTPREL32LSB */
#ifndef R_IA64_DTPREL64LSB
#define R_IA64_DTPREL64LSB                     0xb7
#endif /* R_IA64_DTPREL64LSB */
#ifndef R_IA64_REL32LSB
#define R_IA64_REL32LSB                        0x6d
#endif /* R_IA64_REL32LSB */
#ifndef R_IA64_SECREL32LSB
#define R_IA64_SECREL32LSB                     0x65
#endif /* R_IA64_SECREL32LSB */
#ifndef R_IA64_SECREL64LSB
#define R_IA64_SECREL64LSB                     0x67
#endif /* R_IA64_SECREL64LSB */
#ifndef R_MIPS_32
#define R_MIPS_32                              2
#endif /* R_MIPS_32 */
#ifndef R_MIPS_64
#define R_MIPS_64                              18
#endif /* R_MIPS_64 */
#ifndef R_MIPS_TLS_DTPREL32
#define R_MIPS_TLS_DTPREL32                    39
#endif /* R_MIPS_TLS_DTPREL32 */
#ifndef R_MIPS_TLS_DTPREL64
#define R_MIPS_TLS_DTPREL64                    41
#endif /* R_MIPS_TLS_DTPREL64 */
#ifndef R_PPC64_ADDR64
#define R_PPC64_ADDR64                         38
#endif /* R_PPC64_ADDR64 */
#ifndef R_PPC64_DTPREL32
#define R_PPC64_DTPREL32                       110
#endif /* R_PPC64_DTPREL32 */
#ifndef R_PPC64_DTPREL64
#define R_PPC64_DTPREL64                       78
#endif /* R_PPC64_DTPREL64 */
#ifndef R_PPC_ADDR32
#define R_PPC_ADDR32                           1
#endif /* R_PPC_ADDR32 */
#ifndef R_PPC_DTPREL32
#define R_PPC_DTPREL32                         78
#endif /* R_PPC_DTPREL32 */
#ifndef R_QUALCOMM_REL32
#define R_QUALCOMM_REL32                       6
#endif /* R_QUALCOMM_REL32 */
#ifndef R_SH_DIR32
#define R_SH_DIR32                             1
#endif /* R_SH_DIR32 */
#ifndef R_SH_TLS_DTPOFF32
#define R_SH_TLS_DTPOFF32                      150
#endif /* R_SH_TLS_DTPOFF32 */
#ifndef R_SPARC_TLS_DTPOFF32
#define R_SPARC_TLS_DTPOFF32                   76
#endif /* R_SPARC_TLS_DTPOFF32 */
#ifndef R_SPARC_TLS_DTPOFF64
#define R_SPARC_TLS_DTPOFF64                   77
#endif /* R_SPARC_TLS_DTPOFF64 */
#ifndef R_SPARC_UA32
#define R_SPARC_UA32                           23
#endif /* R_SPARC_UA32 */
#ifndef R_SPARC_UA64
#define R_SPARC_UA64                           54
#endif /* R_SPARC_UA64 */
#ifndef R_X86_64_32
#define R_X86_64_32                            10
#endif /* R_X86_64_32 */
#ifndef R_X86_64_64
#define R_X86_64_64                            1
#endif /* R_X86_64_64 */
#ifndef R_X86_64_DTPOFF32
#define R_X86_64_DTPOFF32                      21
#endif /* R_X86_64_DTPOFF32 */
#ifndef R_X86_64_DTPOFF64
#define R_X86_64_DTPOFF64                      17
#endif /* R_X86_64_DTPOFF64 */
#ifndef R_X86_64_PC32
#define R_X86_64_PC32                          2
#endif /* R_X86_64_PC32 */

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* DWARF_ELF_DEFINES_H */