xref: /illumos-gate/usr/src/lib/libdwarf/common/dwarf_elf_defines.h (revision 4d9fdb46b215739778ebc12079842c9905586999)
1 /* Copyright (c) 2019, David Anderson
2 All rights reserved.
3 
4 Redistribution and use in source and binary forms, with
5 or without modification, are permitted provided that the
6 following conditions are met:
7 
8     Redistributions of source code must retain the above
9     copyright notice, this list of conditions and the following
10     disclaimer.
11 
12     Redistributions in binary form must reproduce the above
13     copyright notice, this list of conditions and the following
14     disclaimer in the documentation and/or other materials
15     provided with the distribution.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
18 CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
19 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 */
32 #ifndef DWARF_ELF_DEFINES_H
33 #define DWARF_ELF_DEFINES_H
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38 
39 /*  Use the system headers if they are available. */
40 #ifdef HAVE_ELF_H
41 #include <elf.h>
42 #endif /* HAVE_ELF_H */
43 
44 /*  Relocation definitions are in sys/elf_{mach}.h on Solaris.  */
45 #ifdef HAVE_LIBELF_H
46 #include <libelf.h>
47 #else
48 #ifdef HAVE_LIBELF_LIBELF_H
49 #include <libelf/libelf.h>
50 #endif /* HAVE_LIBELF_LIBELF_H */
51 #endif /* HAVE_LIBELF_H */
52 
53 /* Standard Elf section types. */
54 #ifndef SHT_NULL
55 #define SHT_NULL 0
56 #endif
57 #ifndef SHT_PROGBITS
58 #define SHT_PROGBITS 1
59 #endif
60 #ifndef SHT_SYMTAB
61 #define SHT_SYMTAB 2
62 #endif
63 #ifndef SHT_STRTAB
64 #define SHT_STRTAB 3
65 #endif
66 #ifndef SHT_RELA
67 #define SHT_RELA 4
68 #endif
69 #ifndef SHT_REL
70 #define SHT_REL 9
71 #endif
72 
73 #ifndef DW_GROUPNUMBER_BASE
74 #define DW_GROUPNUMBER_BASE 1
75 #endif
76 #ifndef DW_GROUPNUMBER_DWO
77 #define DW_GROUPNUMBER_DWO  2
78 #endif
79 
80 #ifndef SHF_GROUP
81 #define SHF_GROUP  (1 << 9)
82 #endif /* SHF_GROUP */
83 
84 #ifndef STN_UNDEF
85 #define STN_UNDEF  0
86 #endif /* STN_UNDEF */
87 
88 #ifndef SHT_HASH
89 #define SHT_HASH 5
90 #endif
91 #ifndef SHT_DYNAMIC
92 #define SHT_DYNAMIC 6
93 #endif
94 #ifndef SHT_NOTE
95 #define SHT_NOTE 7
96 #endif
97 #ifndef SHT_NOBITS
98 #define SHT_NOBITS 8
99 #endif
100 #ifndef SHT_REL
101 #define SHT_REL  9
102 #endif
103 #ifndef SHT_SHLIB
104 #define SHT_SHLIB 10
105 #endif
106 #ifndef SHT_DYNSYM
107 #define SHT_DYNSYM 11
108 #endif
109 #ifndef SHT_GROUP
110 #define SHT_GROUP  17
111 #endif /* SHT_GROUP */
112 
113 /* Symbol Types, Elf standard. */
114 #define STT_NOTYPE  0
115 #define STT_OBJECT  1
116 #define STT_FUNC    2
117 #define STT_SECTION 3
118 #define STT_FILE    4
119 
120 #ifndef PT_NULL
121 #define PT_NULL 0
122 #endif
123 #ifndef PT_LOAD
124 #define PT_LOAD 1
125 #endif
126 #ifndef PT_DYNAMIC
127 #define PT_DYNAMIC 2
128 #endif
129 #ifndef PT_INTERP
130 #define PT_INTERP 3
131 #endif
132 #ifndef PT_NOTE
133 #define PT_NOTE 4
134 #endif
135 #ifndef PT_SHLIB
136 #define PT_SHLIB 5
137 #endif
138 #ifndef PT_PHDR
139 #define PT_PHDR 6
140 #endif
141 #ifndef PT_LOPROC
142 #define PT_LOPROC 0x70000000
143 #endif
144 #ifndef PT_HIPROC
145 #define PT_HIPROC 0x7fffffff
146 #endif
147 
148 #ifndef PF_X
149 #define PF_X            (1 << 0)
150 #endif
151 #ifndef PF_W
152 #define PF_W            (1 << 1)
153 #endif
154 #ifndef PF_R
155 #define PF_R            (1 << 2)
156 #endif
157 #ifndef PF_MASKOS
158 #define PF_MASKOS       0x0ff00000
159 #endif
160 #ifndef PF_MASKPROC
161 #define PF_MASKPROC     0xf0000000
162 #endif
163 
164 
165 #ifndef ET_NONE
166 #define ET_NONE          0
167 #endif
168 #ifndef ET_REL
169 #define ET_REL           1
170 #endif
171 #ifndef ET_EXEC
172 #define ET_EXEC          2
173 #endif
174 #ifndef ET_DYN
175 #define ET_DYN           3
176 #endif
177 #ifndef ET_CORE
178 #define ET_CORE          4
179 #endif
180 #ifndef ET_NUM
181 #define ET_NUM           5
182 #endif
183 #ifndef ET_LOOS
184 #define ET_LOOS          0xfe00
185 #endif
186 #ifndef ET_HIOS
187 #define ET_HIOS          0xfeff
188 #endif
189 #ifndef ET_LOPROC
190 #define ET_LOPROC        0xff00
191 #endif
192 #ifndef ET_HIPROC
193 #define ET_HIPROC        0xffff
194 #endif
195 
196 
197 #ifndef EM_NONE
198 #define EM_NONE          0
199 #endif
200 #ifndef EM_M32
201 #define EM_M32           1
202 #endif
203 #ifndef EM_SPARC
204 #define EM_SPARC         2
205 #endif
206 #ifndef EM_386
207 #define EM_386           3
208 #endif
209 #ifndef EM_68K
210 #define EM_68K           4
211 #endif
212 #ifndef EM_88K
213 #define EM_88K           5
214 #endif
215 #ifndef EM_IAMCU
216 #define EM_IAMCU         6
217 #endif
218 #ifndef EM_860
219 #define EM_860           7
220 #endif
221 #ifndef EM_MIPS
222 #define EM_MIPS          8
223 #endif
224 #ifndef EM_S370
225 #define EM_S370          9
226 #endif
227 #ifndef EM_MIPS_RS3_LE
228 #define EM_MIPS_RS3_LE   10
229 #endif
230 #ifndef EM_PARISC
231 #define EM_PARISC        15
232 #endif
233 #ifndef EM_VPP500
234 #define EM_VPP500        17
235 #endif
236 #ifndef EM_SPARC32PLUS
237 #define EM_SPARC32PLUS   18
238 #endif
239 #ifndef EM_960
240 #define EM_960           19
241 #endif
242 #ifndef EM_PPC
243 #define EM_PPC           20
244 #endif
245 #ifndef EM_PPC64
246 #define EM_PPC64         21
247 #endif
248 #ifndef EM_S390
249 #define EM_S390          22
250 #endif
251 #ifndef EM_SPU
252 #define EM_SPU           23
253 #endif
254 #ifndef EM_V800
255 #define EM_V800          36
256 #endif
257 #ifndef EM_FR20
258 #define EM_FR20          37
259 #endif
260 #ifndef EM_RH32
261 #define EM_RH32          38
262 #endif
263 #ifndef EM_RCE
264 #define EM_RCE           39
265 #endif
266 #ifndef EM_ARM
267 #define EM_ARM           40
268 #endif
269 #ifndef EM_FAKE_ALPHA
270 #define EM_FAKE_ALPHA    41
271 #endif
272 #ifndef EM_SH
273 #define EM_SH            42
274 #endif
275 #ifndef EM_SPARCV9
276 #define EM_SPARCV9       43
277 #endif
278 #ifndef EM_TRICORE
279 #define EM_TRICORE       44
280 #endif
281 #ifndef EM_ARC
282 #define EM_ARC           45
283 #endif
284 #ifndef EM_H8_300
285 #define EM_H8_300        46
286 #endif
287 #ifndef EM_H8_300H
288 #define EM_H8_300H       47
289 #endif
290 #ifndef EM_H8S
291 #define EM_H8S           48
292 #endif
293 #ifndef EM_H8_500
294 #define EM_H8_500        49
295 #endif
296 #ifndef EM_IA_64
297 #define EM_IA_64         50
298 #endif
299 #ifndef EM_MIPS_X
300 #define EM_MIPS_X        51
301 #endif
302 #ifndef EM_COLDFIRE
303 #define EM_COLDFIRE      52
304 #endif
305 #ifndef EM_68HC12
306 #define EM_68HC12        53
307 #endif
308 #ifndef EM_MMA
309 #define EM_MMA           54
310 #endif
311 #ifndef EM_PCP
312 #define EM_PCP           55
313 #endif
314 #ifndef EM_NCPU
315 #define EM_NCPU          56
316 #endif
317 #ifndef EM_NDR1
318 #define EM_NDR1          57
319 #endif
320 #ifndef EM_STARCORE
321 #define EM_STARCORE      58
322 #endif
323 #ifndef EM_ME16
324 #define EM_ME16          59
325 #endif
326 #ifndef EM_ST100
327 #define EM_ST100         60
328 #endif
329 #ifndef EM_TINYJ
330 #define EM_TINYJ         61
331 #endif
332 #ifndef EM_X86_64
333 #define EM_X86_64        62
334 #endif
335 #ifndef EM_PDSP
336 #define EM_PDSP          63
337 #endif
338 #ifndef EM_PDP10
339 #define EM_PDP10         64
340 #endif
341 #ifndef EM_PDP11
342 #define EM_PDP11         65
343 #endif
344 #ifndef EM_FX66
345 #define EM_FX66          66
346 #endif
347 #ifndef EM_ST9PLUS
348 #define EM_ST9PLUS       67
349 #endif
350 #ifndef EM_ST7
351 #define EM_ST7           68
352 #endif
353 #ifndef EM_68HC16
354 #define EM_68HC16        69
355 #endif
356 #ifndef EM_68HC11
357 #define EM_68HC11        70
358 #endif
359 #ifndef EM_68HC08
360 #define EM_68HC08        71
361 #endif
362 #ifndef EM_68HC05
363 #define EM_68HC05        72
364 #endif
365 #ifndef EM_SVX
366 #define EM_SVX           73
367 #endif
368 #ifndef EM_ST19
369 #define EM_ST19          74
370 #endif
371 #ifndef EM_VAX
372 #define EM_VAX           75
373 #endif
374 #ifndef EM_CRIS
375 #define EM_CRIS          76
376 #endif
377 #ifndef EM_JAVELIN
378 #define EM_JAVELIN       77
379 #endif
380 #ifndef EM_FIREPATH
381 #define EM_FIREPATH      78
382 #endif
383 #ifndef EM_ZSP
384 #define EM_ZSP           79
385 #endif
386 #ifndef EM_MMIX
387 #define EM_MMIX          80
388 #endif
389 #ifndef EM_HUANY
390 #define EM_HUANY         81
391 #endif
392 #ifndef EM_PRISM
393 #define EM_PRISM         82
394 #endif
395 #ifndef EM_AVR
396 #define EM_AVR           83
397 #endif
398 #ifndef EM_FR30
399 #define EM_FR30          84
400 #endif
401 #ifndef EM_D10V
402 #define EM_D10V          85
403 #endif
404 #ifndef EM_D30V
405 #define EM_D30V          86
406 #endif
407 #ifndef EM_V850
408 #define EM_V850          87
409 #endif
410 #ifndef EM_M32R
411 #define EM_M32R          88
412 #endif
413 #ifndef EM_MN10300
414 #define EM_MN10300       89
415 #endif
416 #ifndef EM_MN10200
417 #define EM_MN10200       90
418 #endif
419 #ifndef EM_PJ
420 #define EM_PJ            91
421 #endif
422 #ifndef EM_OPENRISC
423 #define EM_OPENRISC      92
424 #endif
425 #ifndef EM_ARC_COMPACT
426 #define EM_ARC_COMPACT   93
427 #endif
428 #ifndef EM_XTENSA
429 #define EM_XTENSA        94
430 #endif
431 #ifndef EM_VIDEOCORE
432 #define EM_VIDEOCORE     95
433 #endif
434 #ifndef EM_TMM_GPP
435 #define EM_TMM_GPP       96
436 #endif
437 #ifndef EM_NS32K
438 #define EM_NS32K         97
439 #endif
440 #ifndef EM_TPC
441 #define EM_TPC           98
442 #endif
443 #ifndef EM_SNP1K
444 #define EM_SNP1K         99
445 #endif
446 #ifndef EM_ST200
447 #define EM_ST200         100
448 #endif
449 #ifndef EM_IP2K
450 #define EM_IP2K          101
451 #endif
452 #ifndef EM_MAX
453 #define EM_MAX           102
454 #endif
455 #ifndef EM_CR
456 #define EM_CR            103
457 #endif
458 #ifndef EM_F2MC16
459 #define EM_F2MC16        104
460 #endif
461 #ifndef EM_MSP430
462 #define EM_MSP430        105
463 #endif
464 #ifndef EM_BLACKFIN
465 #define EM_BLACKFIN      106
466 #endif
467 #ifndef EM_SE_C33
468 #define EM_SE_C33        107
469 #endif
470 #ifndef EM_SEP
471 #define EM_SEP           108
472 #endif
473 #ifndef EM_ARCA
474 #define EM_ARCA          109
475 #endif
476 #ifndef EM_UNICORE
477 #define EM_UNICORE       110
478 #endif
479 #ifndef EM_EXCESS
480 #define EM_EXCESS        111
481 #endif
482 #ifndef EM_DXP
483 #define EM_DXP           112
484 #endif
485 #ifndef EM_ALTERA_NIOS2
486 #define EM_ALTERA_NIOS2  113
487 #endif
488 #ifndef EM_CRX
489 #define EM_CRX           114
490 #endif
491 #ifndef EM_XGATE
492 #define EM_XGATE         115
493 #endif
494 #ifndef EM_C166
495 #define EM_C166          116
496 #endif
497 #ifndef EM_M16C
498 #define EM_M16C          117
499 #endif
500 #ifndef EM_DSPIC30F
501 #define EM_DSPIC30F      118
502 #endif
503 #ifndef EM_CE
504 #define EM_CE            119
505 #endif
506 #ifndef EM_M32C
507 #define EM_M32C          120
508 #endif
509 #ifndef EM_TSK3000
510 #define EM_TSK3000       131
511 #endif
512 #ifndef EM_RS08
513 #define EM_RS08          132
514 #endif
515 #ifndef EM_SHARC
516 #define EM_SHARC         133
517 #endif
518 #ifndef EM_ECOG2
519 #define EM_ECOG2         134
520 #endif
521 #ifndef EM_SCORE7
522 #define EM_SCORE7        135
523 #endif
524 #ifndef EM_DSP24
525 #define EM_DSP24         136
526 #endif
527 #ifndef EM_VIDEOCORE3
528 #define EM_VIDEOCORE3    137
529 #endif
530 #ifndef EM_LATTICEMICO32
531 #define EM_LATTICEMICO32 138
532 #endif
533 #ifndef EM_SE_C17
534 #define EM_SE_C17        139
535 #endif
536 #ifndef EM_TI_C6000
537 #define EM_TI_C6000      140
538 #endif
539 #ifndef EM_TI_C2000
540 #define EM_TI_C2000      141
541 #endif
542 #ifndef EM_TI_C5500
543 #define EM_TI_C5500      142
544 #endif
545 #ifndef EM_TI_ARP32
546 #define EM_TI_ARP32      143
547 #endif
548 #ifndef EM_TI_PRU
549 #define EM_TI_PRU        144
550 #endif
551 #ifndef EM_MMDSP_PLUS
552 #define EM_MMDSP_PLUS    160
553 #endif
554 #ifndef EM_CYPRESS_M8C
555 #define EM_CYPRESS_M8C   161
556 #endif
557 #ifndef EM_R32C
558 #define EM_R32C          162
559 #endif
560 #ifndef EM_TRIMEDIA
561 #define EM_TRIMEDIA      163
562 #endif
563 #ifndef EM_QDSP6
564 #define EM_QDSP6         164
565 #endif
566 #ifndef EM_QUALCOMM_DSP6
567 #define EM_QUALCOMM_DSP6 164
568 #endif
569 #ifndef EM_8051
570 #define EM_8051          165
571 #endif
572 #ifndef EM_STXP7X
573 #define EM_STXP7X        166
574 #endif
575 #ifndef EM_NDS32
576 #define EM_NDS32         167
577 #endif
578 #ifndef EM_ECOG1X
579 #define EM_ECOG1X        168
580 #endif
581 #ifndef EM_MAXQ30
582 #define EM_MAXQ30        169
583 #endif
584 #ifndef EM_XIMO16
585 #define EM_XIMO16        170
586 #endif
587 #ifndef EM_MANIK
588 #define EM_MANIK         171
589 #endif
590 #ifndef EM_CRAYNV2
591 #define EM_CRAYNV2       172
592 #endif
593 #ifndef EM_RX
594 #define EM_RX            173
595 #endif
596 #ifndef EM_METAG
597 #define EM_METAG         174
598 #endif
599 #ifndef EM_MCST_ELBRUS
600 #define EM_MCST_ELBRUS   175
601 #endif
602 #ifndef EM_ECOG16
603 #define EM_ECOG16        176
604 #endif
605 #ifndef EM_CR16
606 #define EM_CR16          177
607 #endif
608 #ifndef EM_ETPU
609 #define EM_ETPU          178
610 #endif
611 #ifndef EM_SLE9X
612 #define EM_SLE9X         179
613 #endif
614 #ifndef EM_L10M
615 #define EM_L10M          180
616 #endif
617 #ifndef EM_K10M
618 #define EM_K10M          181
619 #endif
620 #ifndef EM_AARCH64
621 #define EM_AARCH64       183
622 #endif
623 #ifndef EM_AVR32
624 #define EM_AVR32         185
625 #endif
626 #ifndef EM_STM8
627 #define EM_STM8          186
628 #endif
629 #ifndef EM_TILE64
630 #define EM_TILE64        187
631 #endif
632 #ifndef EM_TILEPRO
633 #define EM_TILEPRO       188
634 #endif
635 #ifndef EM_MICROBLAZE
636 #define EM_MICROBLAZE    189
637 #endif
638 #ifndef EM_CUDA
639 #define EM_CUDA          190
640 #endif
641 #ifndef EM_TILEGX
642 #define EM_TILEGX        191
643 #endif
644 #ifndef EM_CLOUDSHIELD
645 #define EM_CLOUDSHIELD   192
646 #endif
647 #ifndef EM_COREA_1ST
648 #define EM_COREA_1ST     193
649 #endif
650 #ifndef EM_COREA_2ND
651 #define EM_COREA_2ND     194
652 #endif
653 #ifndef EM_ARC_COMPACT2
654 #define EM_ARC_COMPACT2  195
655 #endif
656 #ifndef EM_OPEN8
657 #define EM_OPEN8         196
658 #endif
659 #ifndef EM_RL78
660 #define EM_RL78          197
661 #endif
662 #ifndef EM_VIDEOCORE5
663 #define EM_VIDEOCORE5    198
664 #endif
665 #ifndef EM_78KOR
666 #define EM_78KOR         199
667 #endif
668 #ifndef EM_56800EX
669 #define EM_56800EX       200
670 #endif
671 #ifndef EM_BA1
672 #define EM_BA1           201
673 #endif
674 #ifndef EM_BA2
675 #define EM_BA2           202
676 #endif
677 #ifndef EM_XCORE
678 #define EM_XCORE         203
679 #endif
680 #ifndef EM_MCHP_PIC
681 #define EM_MCHP_PIC      204
682 #endif
683 #ifndef EM_KM32
684 #define EM_KM32          210
685 #endif
686 #ifndef EM_KMX32
687 #define EM_KMX32         211
688 #endif
689 #ifndef EM_EMX16
690 #define EM_EMX16         212
691 #endif
692 #ifndef EM_EMX8
693 #define EM_EMX8          213
694 #endif
695 #ifndef EM_KVARC
696 #define EM_KVARC         214
697 #endif
698 #ifndef EM_CDP
699 #define EM_CDP           215
700 #endif
701 #ifndef EM_COGE
702 #define EM_COGE          216
703 #endif
704 #ifndef EM_COOL
705 #define EM_COOL          217
706 #endif
707 #ifndef EM_NORC
708 #define EM_NORC          218
709 #endif
710 #ifndef EM_CSR_KALIMBA
711 #define EM_CSR_KALIMBA   219
712 #endif
713 #ifndef EM_Z80
714 #define EM_Z80           220
715 #endif
716 #ifndef EM_VISIUM
717 #define EM_VISIUM        221
718 #endif
719 #ifndef EM_FT32
720 #define EM_FT32          222
721 #endif
722 #ifndef EM_MOXIE
723 #define EM_MOXIE         223
724 #endif
725 #ifndef EM_AMDGPU
726 #define EM_AMDGPU        224
727 #endif
728 #ifndef EM_RISCV
729 #define EM_RISCV         243
730 #endif
731 #ifndef EM_BPF
732 #define EM_BPF           247
733 #endif
734 
735 /* Standard Elf dynamic tags. */
736 #ifndef DT_NULL
737 #define DT_NULL 0
738 #endif
739 #ifndef DT_NEEDED
740 #define DT_NEEDED 1
741 #endif
742 #ifndef DT_PLTRELSZ
743 #define DT_PLTRELSZ 2
744 #endif
745 #ifndef DT_PLTGOT
746 #define DT_PLTGOT 3
747 #endif
748 #ifndef DT_HASH
749 #define DT_HASH 4
750 #endif
751 #ifndef DT_STRTAB
752 #define DT_STRTAB 5
753 #endif
754 #ifndef DT_SYMTAB
755 #define DT_SYMTAB 6
756 #endif
757 #ifndef DT_RELA
758 #define DT_RELA 7
759 #endif
760 #ifndef DT_REL
761 #define DT_REL 17
762 #endif
763 #ifndef DT_RELASZ
764 #define DT_RELASZ 8
765 #endif
766 #ifndef DT_RELAENT
767 #define DT_RELAENT 9
768 #endif
769 #ifndef DT_STRSZ
770 #define DT_STRSZ  10
771 #endif
772 
773 #ifndef DT_SYMENT
774 #define DT_SYMENT 11
775 #endif
776 
777 #ifndef DT_INIT
778 #define DT_INIT 12
779 #endif
780 
781 #ifndef DT_FINI
782 #define DT_FINI 13
783 #endif
784 
785 #ifndef DT_SONAME
786 #define DT_SONAME 14
787 #endif
788 
789 #ifndef DT_RPATH
790 #define DT_RPATH 15
791 #endif
792 
793 #ifndef DT_SYMBOLIC
794 #define DT_SYMBOLIC 16
795 #endif
796 
797 #ifndef DT_REL
798 #define DT_REL 17
799 #endif
800 #ifndef DT_RELSZ
801 #define DT_RELSZ 18
802 #endif
803 
804 #ifndef DT_RELENT
805 #define DT_RELENT 19
806 #endif
807 
808 #ifndef DT_PLTREL
809 #define DT_PLTREL 20
810 #endif
811 
812 #ifndef DT_DEBUG
813 #define DT_DEBUG 21
814 #endif
815 
816 #ifndef DT_TEXTREL
817 #define DT_TEXTREL 22
818 #endif
819 
820 #ifndef DT_JMPREL
821 #define DT_JMPREL 23
822 #endif
823 
824 #ifndef SHN_UNDEF
825 #define SHN_UNDEF 0
826 #endif
827 #ifndef SHN_LORESERVE
828 #define SHN_LORESERVE 0xff00
829 #endif
830 #ifndef SHN_LOPROC
831 #define SHN_LOPROC 0xff00
832 #endif
833 #ifndef SHN_HIPROC
834 #define SHN_HIPROC 0xff1f
835 #endif
836 #ifndef SHN_ABS
837 #define SHN_ABS 0xfff1
838 #endif
839 #ifndef SHN_COMMON
840 #define SHN_COMMON 0xfff2
841 #endif
842 #ifndef SHN_HIRESERVE
843 #define SHN_HIRESERVE 0xffff
844 #endif
845 
846 #ifndef EV_CURRENT
847 #define EV_CURRENT       1
848 #endif
849 #ifndef EV_NONE
850 #define EV_NONE          0
851 #endif
852 
853 #ifndef EI_MAG0
854 #define EI_MAG0          0
855 #endif
856 #ifndef EI_MAG1
857 #define EI_MAG1          1
858 #endif
859 #ifndef EI_MAG2
860 #define EI_MAG2          2
861 #endif
862 #ifndef EI_MAG3
863 #define EI_MAG3          3
864 #endif
865 #ifndef EI_CLASS
866 #define EI_CLASS         4
867 #endif
868 #ifndef EI_DATA
869 #define EI_DATA          5
870 #endif
871 #ifndef EI_VERSION
872 #define EI_VERSION       6
873 #endif
874 #ifndef EI_PAD
875 #define EI_PAD           7
876 #endif
877 #ifndef EI_OSABI
878 #define EI_OSABI         7
879 #endif
880 #ifndef EI_NIDENT
881 #define EI_NIDENT        16
882 #endif
883 #ifndef EI_ABIVERSION
884 #define EI_ABIVERSION       8
885 #endif
886 
887 #ifndef ELFMAG0
888 #define ELFMAG0          0x7f
889 #endif
890 #ifndef ELFMAG1
891 #define ELFMAG1          'E'
892 #endif
893 #ifndef ELFMAG2
894 #define ELFMAG2          'L'
895 #endif
896 #ifndef ELFMAG3
897 #define ELFMAG3          'F'
898 #endif
899 #ifndef ELFCLASSNONE
900 #define ELFCLASSNONE     0
901 #endif
902 #ifndef ELFCLASS32
903 #define ELFCLASS32       1
904 #endif
905 #ifndef ELFCLASS64
906 #define ELFCLASS64       2
907 #endif
908 #ifndef ELFDATANONE
909 #define ELFDATANONE      0
910 #endif
911 #ifndef ELFDATA2LSB
912 #define ELFDATA2LSB      1
913 #endif
914 #ifndef ELFDATA2MSB
915 #define ELFDATA2MSB      2
916 #endif
917 
918 #ifndef ELFOSABI_NONE
919 #define ELFOSABI_NONE       0
920 #endif
921 #ifndef ELFOSABI_SYSV
922 #define ELFOSABI_SYSV       0
923 #endif
924 #ifndef ELFOSABI_HPUX
925 #define ELFOSABI_HPUX       1
926 #endif
927 #ifndef ELFOSABI_NETBSD
928 #define ELFOSABI_NETBSD     2
929 #endif
930 #ifndef ELFOSABI_GNU
931 #define ELFOSABI_GNU        3
932 #endif
933 #ifndef ELFOSABI_LINUX
934 #define ELFOSABI_LINUX      ELFOSABI_GNU
935 #endif
936 #ifndef ELFOSABI_SOLARIS
937 #define ELFOSABI_SOLARIS    6
938 #endif
939 #ifndef ELFOSABI_AIX
940 #define ELFOSABI_AIX        7
941 #endif
942 #ifndef ELFOSABI_IRIX
943 #define ELFOSABI_IRIX       8
944 #endif
945 #ifndef ELFOSABI_FREEBSD
946 #define ELFOSABI_FREEBSD    9
947 #endif
948 #ifndef ELFOSABI_TRU64
949 #define ELFOSABI_TRU64      10
950 #endif
951 #ifndef ELFOSABI_MODESTO
952 #define ELFOSABI_MODESTO    11
953 #endif
954 #ifndef ELFOSABI_OPENBSD
955 #define ELFOSABI_OPENBSD    12
956 #endif
957 #ifndef ELFOSABI_ARM_AEABI
958 #define ELFOSABI_ARM_AEABI  64
959 #endif
960 #ifndef ELFOSABI_ARM
961 #define ELFOSABI_ARM        97
962 #endif
963 #ifndef ELFOSABI_STANDALONE
964 #define ELFOSABI_STANDALONE 255
965 #endif
966 
967 
968 /* for the producer code. */
969 #ifndef R_MIPS_NONE
970 #define R_MIPS_NONE 0
971 #endif
972 #ifndef R_QUALCOMM_REL32
973 #define R_QUALCOMM_REL32   6
974 #endif
975 /*  For Freebsd: */
976 #ifndef R_PPC64_ADDR32
977 #define R_PPC64_ADDR32     1
978 #endif
979 #ifndef R_PPC64_DTPREL32
980 #define R_PPC64_DTPREL32 110
981 #endif
982 #ifndef R_PPC64_DTPREL64
983 #define R_PPC64_DTPREL64 78
984 #endif
985 #ifndef R_PPC_DTPREL32
986 #define R_PPC_DTPREL32   78
987 #endif
988 /* The following two probably useless. */
989 #ifndef R_X86_64_PC32_BND
990 #define R_X86_64_PC32_BND 39
991 #endif
992 #ifndef R_X86_64_PLT32_BND
993 #define R_X86_64_PLT32_BND  40
994 #endif
995 
996 #ifndef R_386_32
997 #define R_386_32                               1
998 #endif /* R_386_32 */
999 #ifndef R_386_PC32
1000 #define R_386_PC32                             2
1001 #endif /* R_386_PC32 */
1002 #ifndef R_386_TLS_DTPOFF32
1003 #define R_386_TLS_DTPOFF32                     36
1004 #endif /* R_386_TLS_DTPOFF32 */
1005 #ifndef R_386_TLS_LDO_32
1006 #define R_386_TLS_LDO_32                       32
1007 #endif /* R_386_TLS_LDO_32 */
1008 #ifndef R_390_32
1009 #define R_390_32                               4
1010 #endif /* R_390_32 */
1011 #ifndef R_390_64
1012 #define R_390_64                               22
1013 #endif /* R_390_64 */
1014 #ifndef R_390_TLS_LDO32
1015 #define R_390_TLS_LDO32                        52
1016 #endif /* R_390_TLS_LDO32 */
1017 #ifndef R_390_TLS_LDO64
1018 #define R_390_TLS_LDO64                        53
1019 #endif /* R_390_TLS_LDO64 */
1020 #ifndef R_AARCH64_ABS32
1021 #define R_AARCH64_ABS32                        258
1022 #endif /* R_AARCH64_ABS32 */
1023 #ifndef R_AARCH64_ABS64
1024 #define R_AARCH64_ABS64                        257
1025 #endif /* R_AARCH64_ABS64 */
1026 #ifndef R_ARM_ABS32
1027 #define R_ARM_ABS32                            2
1028 #endif /* R_ARM_ABS32 */
1029 #ifndef R_ARM_TLS_LDO32
1030 #define R_ARM_TLS_LDO32                        106
1031 #endif /* R_ARM_TLS_LDO32 */
1032 #ifndef R_IA64_DIR32LSB
1033 #define R_IA64_DIR32LSB                        0x25
1034 #endif /* R_IA64_DIR32LSB */
1035 #ifndef R_IA64_DIR64LSB
1036 #define R_IA64_DIR64LSB                        0x27
1037 #endif /* R_IA64_DIR64LSB */
1038 #ifndef R_IA64_DTPREL32LSB
1039 #define R_IA64_DTPREL32LSB                     0xb5
1040 #endif /* R_IA64_DTPREL32LSB */
1041 #ifndef R_IA64_DTPREL64LSB
1042 #define R_IA64_DTPREL64LSB                     0xb7
1043 #endif /* R_IA64_DTPREL64LSB */
1044 #ifndef R_IA64_REL32LSB
1045 #define R_IA64_REL32LSB                        0x6d
1046 #endif /* R_IA64_REL32LSB */
1047 #ifndef R_IA64_SECREL32LSB
1048 #define R_IA64_SECREL32LSB                     0x65
1049 #endif /* R_IA64_SECREL32LSB */
1050 #ifndef R_IA64_SECREL64LSB
1051 #define R_IA64_SECREL64LSB                     0x67
1052 #endif /* R_IA64_SECREL64LSB */
1053 #ifndef R_MIPS_32
1054 #define R_MIPS_32                              2
1055 #endif /* R_MIPS_32 */
1056 #ifndef R_MIPS_64
1057 #define R_MIPS_64                              18
1058 #endif /* R_MIPS_64 */
1059 #ifndef R_MIPS_TLS_DTPREL32
1060 #define R_MIPS_TLS_DTPREL32                    39
1061 #endif /* R_MIPS_TLS_DTPREL32 */
1062 #ifndef R_MIPS_TLS_DTPREL64
1063 #define R_MIPS_TLS_DTPREL64                    41
1064 #endif /* R_MIPS_TLS_DTPREL64 */
1065 #ifndef R_PPC64_ADDR64
1066 #define R_PPC64_ADDR64                         38
1067 #endif /* R_PPC64_ADDR64 */
1068 #ifndef R_PPC64_DTPREL32
1069 #define R_PPC64_DTPREL32                       110
1070 #endif /* R_PPC64_DTPREL32 */
1071 #ifndef R_PPC64_DTPREL64
1072 #define R_PPC64_DTPREL64                       78
1073 #endif /* R_PPC64_DTPREL64 */
1074 #ifndef R_PPC_ADDR32
1075 #define R_PPC_ADDR32                           1
1076 #endif /* R_PPC_ADDR32 */
1077 #ifndef R_PPC_DTPREL32
1078 #define R_PPC_DTPREL32                         78
1079 #endif /* R_PPC_DTPREL32 */
1080 #ifndef R_QUALCOMM_REL32
1081 #define R_QUALCOMM_REL32                       6
1082 #endif /* R_QUALCOMM_REL32 */
1083 #ifndef R_SH_DIR32
1084 #define R_SH_DIR32                             1
1085 #endif /* R_SH_DIR32 */
1086 #ifndef R_SH_TLS_DTPOFF32
1087 #define R_SH_TLS_DTPOFF32                      150
1088 #endif /* R_SH_TLS_DTPOFF32 */
1089 #ifndef R_SPARC_TLS_DTPOFF32
1090 #define R_SPARC_TLS_DTPOFF32                   76
1091 #endif /* R_SPARC_TLS_DTPOFF32 */
1092 #ifndef R_SPARC_TLS_DTPOFF64
1093 #define R_SPARC_TLS_DTPOFF64                   77
1094 #endif /* R_SPARC_TLS_DTPOFF64 */
1095 #ifndef R_SPARC_UA32
1096 #define R_SPARC_UA32                           23
1097 #endif /* R_SPARC_UA32 */
1098 #ifndef R_SPARC_UA64
1099 #define R_SPARC_UA64                           54
1100 #endif /* R_SPARC_UA64 */
1101 #ifndef R_X86_64_32
1102 #define R_X86_64_32                            10
1103 #endif /* R_X86_64_32 */
1104 #ifndef R_X86_64_64
1105 #define R_X86_64_64                            1
1106 #endif /* R_X86_64_64 */
1107 #ifndef R_X86_64_DTPOFF32
1108 #define R_X86_64_DTPOFF32                      21
1109 #endif /* R_X86_64_DTPOFF32 */
1110 #ifndef R_X86_64_DTPOFF64
1111 #define R_X86_64_DTPOFF64                      17
1112 #endif /* R_X86_64_DTPOFF64 */
1113 #ifndef R_X86_64_PC32
1114 #define R_X86_64_PC32                          2
1115 #endif /* R_X86_64_PC32 */
1116 
1117 #ifdef __cplusplus
1118 }
1119 #endif /* __cplusplus */
1120 
1121 #endif /* DWARF_ELF_DEFINES_H */
1122