BR 2826669: update licensing information in README
[nasm.git] / output / outelf.h
bloba5bbd5632992d9dded496e0b9ce06b1b54a9774e
1 /* ----------------------------------------------------------------------- *
2 *
3 * Copyright 1996-2009 The NASM Authors - All Rights Reserved
4 * See the file AUTHORS included with the NASM distribution for
5 * the specific copyright holders.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following
9 * conditions are met:
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 * ----------------------------------------------------------------------- */
35 * Internal definitions common to outelf32 and outelf64
37 #ifndef OUTPUT_OUTELF_H
38 #define OUTPUT_OUTELF_H
40 #define SYM_GLOBAL 0x10
42 #define GLOBAL_TEMP_BASE 0x40000000 /* bigger than any sane symbol index */
44 #define SEG_ALIGN 16 /* alignment of sections in file */
45 #define SEG_ALIGN_1 (SEG_ALIGN-1)
47 /* this stuff is needed for the stabs debugging format */
48 #define N_SO 0x64 /* ID for main source file */
49 #define N_SOL 0x84 /* ID for sub-source file */
50 #define N_BINCL 0x82
51 #define N_EINCL 0xA2
52 #define N_SLINE 0x44
53 #define TY_STABSSYMLIN 0x40 /* ouch */
55 /* this stuff is needed for the dwarf debugging format */
56 #define TY_DEBUGSYMLIN 0x40 /* internal call to debug_out */
58 /* Known sections with nonstandard defaults */
59 struct elf_known_section {
60 const char *name; /* Name of section */
61 int type; /* Section type (SHT_) */
62 uint32_t flags; /* Section flags (SHF_) */
63 uint32_t align; /* Section alignment */
65 extern const struct elf_known_section elf_known_sections[];
68 * Special ELF sections (after the real sections but before debugging ones)
70 #define sec_shstrtab (nsects + 1)
71 #define sec_symtab (nsects + 2)
72 #define sec_strtab (nsects + 3)
73 #define sec_numspecial 3
76 * Debugging ELF sections (last in the file)
79 /* stabs */
80 #define sec_stab (nsections-3)
81 #define sec_stabstr (nsections-2)
82 #define sec_rel_stab (nsections-1)
84 /* dwarf */
85 #define sec_debug_aranges (nsections-10)
86 #define sec_rela_debug_aranges (nsections-9)
87 #define sec_debug_pubnames (nsections-8)
88 #define sec_debug_info (nsections-7)
89 #define sec_rela_debug_info (nsections-6)
90 #define sec_debug_abbrev (nsections-5)
91 #define sec_debug_line (nsections-4)
92 #define sec_rela_debug_line (nsections-3)
93 #define sec_debug_frame (nsections-2)
94 #define sec_debug_loc (nsections-1)
96 #endif /* OUTPUT_OUTELF_H */