* SUCH DAMAGE.
*
* $FreeBSD: src/include/dlfcn.h,v 1.10.2.3 2003/02/20 20:42:45 kan Exp $
- * $DragonFly: src/include/dlfcn.h,v 1.5 2004/02/26 13:58:25 joerg Exp $
*/
#ifndef _DLFCN_H_
/*
* Modes and flags for dlopen().
*/
-#define RTLD_LAZY 1 /* Bind function calls lazily */
-#define RTLD_NOW 2 /* Bind function calls immediately */
-#define RTLD_MODEMASK 0x3
-#define RTLD_GLOBAL 0x100 /* Make symbols globally available */
-#define RTLD_LOCAL 0 /* Opposite of RTLD_GLOBAL, and the default */
-#define RTLD_TRACE 0x200 /* Trace loaded objects and exit */
+#define RTLD_LAZY 1 /* Bind function calls lazily. */
+#define RTLD_NOW 2 /* Bind function calls immediately. */
+#define RTLD_MODEMASK 0x3
+#define RTLD_GLOBAL 0x100 /* Make symbols globally available. */
+#define RTLD_LOCAL 0 /* Opposite of RTLD_GLOBAL, and the default. */
+#define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */
/*
* Request arguments for dlinfo().
*/
-#define RTLD_DI_LINKMAP 2
-#define RTLD_DI_SERINFO 4
-#define RTLD_DI_SERINFOSIZE 5
-#define RTLD_DI_ORIGIN 6
+#define RTLD_DI_LINKMAP 2 /* Obtain link map. */
+#define RTLD_DI_SERINFO 4 /* Obtain search path info. */
+#define RTLD_DI_SERINFOSIZE 5 /* ... query for required space. */
+#define RTLD_DI_ORIGIN 6 /* Obtain object origin */
/*
* Special handle arguments for dlsym()/dlinfo().
*/
-#define RTLD_NEXT ((void *) -1) /* Search subsequent objects */
-#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm */
+#define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */
+#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
#define RTLD_SELF ((void *) -3) /* Search the caller itself. */
#if __BSD_VISIBLE
* Structure filled in by dladdr().
*/
typedef struct dl_info {
- const char *dli_fname; /* Pathname of shared object */
- void *dli_fbase; /* Base address of shared object */
- const char *dli_sname; /* Name of nearest symbol */
- void *dli_saddr; /* Address of nearest symbol */
+ const char *dli_fname; /* Pathname of shared object. */
+ void *dli_fbase; /* Base address of shared object. */
+ const char *dli_sname; /* Name of nearest symbol. */
+ void *dli_saddr; /* Address of nearest symbol. */
} Dl_info;
/*
#endif /* __BSD_VISIBLE */
__BEGIN_DECLS
-/* XSI functions first */
+/* XSI functions first. */
int dlclose(void *);
const char *dlerror(void);
void *dlopen(const char *, int);
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/sys/elf_common.h,v 1.5.2.3 2001/02/28 02:30:46 obrien Exp $
- * $DragonFly: src/sys/sys/elf_common.h,v 1.22 2007/12/15 11:39:15 swildner Exp $
*/
#ifndef _SYS_ELF_COMMON_H_
} Elf_Note;
/* Indexes into the e_ident array. Keep synced with
- http://www.caldera.com/developers/gabi/ */
+ http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
#define EI_MAG0 0 /* Magic number, byte 0. */
#define EI_MAG1 1 /* Magic number, byte 1. */
#define EI_MAG2 2 /* Magic number, byte 2. */
#define ELFMAG1 'E'
#define ELFMAG2 'L'
#define ELFMAG3 'F'
-#define ELFMAG "\177ELF"
-#define SELFMAG 4
+#define ELFMAG "\177ELF" /* magic string */
+#define SELFMAG 4 /* magic string size */
/* Values for e_ident[EI_VERSION] and e_version. */
#define EV_NONE 0
#define ET_EXEC 2 /* Executable. */
#define ET_DYN 3 /* Shared object. */
#define ET_CORE 4 /* Core file. */
-#define ET_LOOS 0xfe00 /* OS-specific range start. */
-#define ET_HIOS 0xfeff /* OS-specific range end. */
-#define ET_LOPROC 0xff00 /* Processor-specific range start. */
-#define ET_HIPROC 0xffff /* Processor-specific range end. */
+#define ET_LOOS 0xfe00 /* First operating system specific. */
+#define ET_HIOS 0xfeff /* Last operating system-specific. */
+#define ET_LOPROC 0xff00 /* First processor-specific. */
+#define ET_HIPROC 0xffff /* Last processor-specific. */
/* Values for e_machine. */
#define EM_NONE 0 /* Unknown machine. */
#define EM_88K 5 /* Motorola 88000. */
/* 6 reserved (was EM_486) */
#define EM_860 7 /* Intel i860. */
-#define EM_MIPS 8 /* MIPS R3000 Big-Endian only */
+#define EM_MIPS 8 /* MIPS R3000 Big-Endian only. */
/* Extensions. */
-#define EM_S370 9 /* IBM System/370 */
+#define EM_S370 9 /* IBM System/370. */
#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ /* Depreciated */
/* 11-14 reserved */
-#define EM_PARISC 15 /* HPPA */
+#define EM_PARISC 15 /* HP PA-RISC. */
/* 16 reserved */
-#define EM_VPP500 17 /* Fujitsu VPP500 */
-#define EM_SPARC32PLUS 18 /* SPARC v8plus */
-#define EM_960 19 /* Intel 80960 */
-#define EM_PPC 20 /* PowerPC 32-bit */
-#define EM_PPC64 21 /* PowerPC 64-bit */
-#define EM_S390 22 /* IBM S390 */
+#define EM_VPP500 17 /* Fujitsu VPP500. */
+#define EM_SPARC32PLUS 18 /* SPARC v8plus. */
+#define EM_960 19 /* Intel 80960. */
+#define EM_PPC 20 /* PowerPC 32-bit. */
+#define EM_PPC64 21 /* PowerPC 64-bit. */
+#define EM_S390 22 /* IBM System/390. */
/* 23-35 reserved */
-#define EM_V800 36 /* NEC V800 series */
-#define EM_FR20 37 /* Fujitsu FR20 */
-#define EM_RH32 38 /* TRW RH-32 */
-#define EM_RCE 39 /* Motorola RCE */
-#define EM_ARM 40 /* ARM */
+#define EM_V800 36 /* NEC V800. */
+#define EM_FR20 37 /* Fujitsu FR20. */
+#define EM_RH32 38 /* TRW RH-32. */
+#define EM_RCE 39 /* Motorola RCE. */
+#define EM_ARM 40 /* ARM. */
#define EM_ALPHA 41 /* Digital Alpha */
-#define EM_SH 42 /* Hitachi SH */
-#define EM_SPARCV9 43 /* SPARC v9 64-bit */
-#define EM_TRICORE 44 /* Siemens Tricore */
-#define EM_ARC 45 /* Argonaut RISC Core */
-#define EM_H8_300 46 /* Hitachi H8/300 */
-#define EM_H8_300H 47 /* Hitachi H8/300H */
-#define EM_H8S 48 /* Hitachi H8S */
-#define EM_H8_500 49 /* Hitachi H8/500 */
-#define EM_IA_64 50 /* Intel IA-46 Processor */
-#define EM_MIPS_X 51 /* Stanford MIPS-X */
-#define EM_COLDFIRE 52 /* Motorola Coldfire */
-#define EM_68HC12 53 /* Motorola M68HC12 */
-#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/
-#define EM_PCP 55 /* Siemens PCP */
-#define EM_NCPU 56 /* Sony nCPU embeeded RISC */
-#define EM_NDR1 57 /* Denso NDR1 microprocessor */
-#define EM_STARCORE 58 /* Motorola Start*Core processor */
-#define EM_ME16 59 /* Toyota ME16 processor */
-#define EM_ST100 60 /* STMicroelectronic ST100 processor */
-#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/
+#define EM_SH 42 /* Hitachi SH. */
+#define EM_SPARCV9 43 /* SPARC v9 64-bit. */
+#define EM_TRICORE 44 /* Siemens TriCore embedded processor. */
+#define EM_ARC 45 /* Argonaut RISC Core. */
+#define EM_H8_300 46 /* Hitachi H8/300. */
+#define EM_H8_300H 47 /* Hitachi H8/300H. */
+#define EM_H8S 48 /* Hitachi H8S. */
+#define EM_H8_500 49 /* Hitachi H8/500. */
+#define EM_IA_64 50 /* Intel IA-64 Processor. */
+#define EM_MIPS_X 51 /* Stanford MIPS-X. */
+#define EM_COLDFIRE 52 /* Motorola ColdFire. */
+#define EM_68HC12 53 /* Motorola M68HC12. */
+#define EM_MMA 54 /* Fujitsu MMA. */
+#define EM_PCP 55 /* Siemens PCP. */
+#define EM_NCPU 56 /* Sony nCPU. */
+#define EM_NDR1 57 /* Denso NDR1 microprocessor. */
+#define EM_STARCORE 58 /* Motorola Star*Core processor. */
+#define EM_ME16 59 /* Toyota ME16 processor. */
+#define EM_ST100 60 /* STMicroelectronics ST100 processor. */
+#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */
#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */
#define EM_PDSP 63 /* Sony DSP Processor */
#define EM_FX66 66 /* Siemens FX66 microcontroller */
#define SHN_LORESERVE 0xff00 /* First of reserved range. */
#define SHN_LOPROC 0xff00 /* First processor-specific. */
#define SHN_HIPROC 0xff1f /* Last processor-specific. */
-#define SHN_LOOS 0xff20 /* First OS-specific. */
-#define SHN_HIOS 0xff3f /* Last OS-specific. */
+#define SHN_LOOS 0xff20 /* First operating system-specific. */
+#define SHN_HIOS 0xff3f /* Last operating system-specific. */
#define SHN_ABS 0xfff1 /* Absolute values. */
#define SHN_COMMON 0xfff2 /* Common data. */
-#define SHN_XINDEX 0xffff /* Section header index too large. */
+#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere. */
#define SHN_HIRESERVE 0xffff /* Last of reserved range. */
/* sh_type */
#define SHT_PROGBITS 1 /* program defined information */
#define SHT_SYMTAB 2 /* symbol table section */
#define SHT_STRTAB 3 /* string table section */
-#define SHT_RELA 4 /* relocation section with addends*/
+#define SHT_RELA 4 /* relocation section with addends */
#define SHT_HASH 5 /* symbol hash table section */
#define SHT_DYNAMIC 6 /* dynamic section */
#define SHT_NOTE 7 /* note section */
#define SHT_NOBITS 8 /* no space section */
-#define SHT_REL 9 /* relation section without addends */
+#define SHT_REL 9 /* relocation section - no addends */
#define SHT_SHLIB 10 /* reserved - purpose unknown */
#define SHT_DYNSYM 11 /* dynamic symbol table section */
-#define SHT_INIT_ARRAY 14 /* array of constructors */
-#define SHT_FINI_ARRAY 15 /* array of destructors */
-#define SHT_PREINIT_ARRAY 16 /* array of pre-constructors */
-#define SHT_GROUP 17 /* array of pre-constructors */
-#define SHT_SYMTAB_SHNDX 18 /* extended section indices */
+#define SHT_INIT_ARRAY 14 /* Initialization function pointers. */
+#define SHT_FINI_ARRAY 15 /* Termination function pointers. */
+#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */
+#define SHT_GROUP 17 /* Section group. */
+#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX). */
+
#define SHT_NUM 19 /* number of section types */
+
#define SHT_LOOS 0x60000000 /* First of OS specific semantics */
#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */
#define SHT_LOPROC 0x70000000 /* reserved range for processor */
#define SHF_EXECINSTR 0x4 /* Section contains instructions. */
#define SHF_MERGE 0x10 /* Section may be merged. */
#define SHF_STRINGS 0x20 /* Section contains strings. */
-#define SHF_INFO_LINK 0x40 /* sh_info contains SHT index. */
-#define SHF_LINK_ORDER 0x80 /* Preserve order after combining. */
-#define SHF_OS_NONCONFORMING 0x100 /* Section requires OS-specific */
+#define SHF_INFO_LINK 0x40 /* sh_info holds section index. */
+#define SHF_LINK_ORDER 0x80 /* Special ordering requirements. */
+#define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */
/* handling */
#define SHF_GROUP 0x200 /* Section is a member of a group. */
#define SHF_TLS 0x400 /* Section contains TLS data. */
/* Section group flags. */
#define GRP_COMDAT 0x1 /* Group is a COMDAT. */
-#define GRP_MASKOS 0x0ff00000 /* Reserved for OS-specific. */
-#define GRP_MASKPROC 0xf0000000 /* Reserved for processor-specific. */
+#define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */
+#define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */
/* Values for p_type. */
#define PT_NULL 0 /* Unused entry. */
#define PT_COUNT 8 /* Number of defined p_type values. */
-#define PT_LOOS 0x60000000 /* OS-specific */
-#define PT_HIOS 0x6fffffff /* OS-specific */
+#define PT_LOOS 0x60000000 /* First OS-specific. */
+#define PT_HIOS 0x6fffffff /* Last OS-specific. */
#define PT_LOPROC 0x70000000 /* First processor-specific type. */
#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */
#define PF_X 0x1 /* Executable. */
#define PF_W 0x2 /* Writable. */
#define PF_R 0x4 /* Readable. */
-#define PF_MASKOS 0x0ff00000 /* Reserved for OS-specific. */
-#define PF_MASKPROC 0xf0000000 /* Reserved for processor-specific. */
+#define PF_MASKOS 0x0ff00000 /* Operating system-specific. */
+#define PF_MASKPROC 0xf0000000 /* Processor-specific. */
/* Values for d_tag. */
#define DT_NULL 0 /* Terminating entry. */
#define STB_LOCAL 0 /* Local symbol */
#define STB_GLOBAL 1 /* Global symbol */
#define STB_WEAK 2 /* like global - lower precedence */
-#define STB_LOOS 10 /* reserved range for OS specific */
-#define STB_HIOS 12 /* symbol bindings */
+#define STB_LOOS 10 /* Reserved range for operating system */
+#define STB_HIOS 12 /* specific semantics. */
#define STB_LOPROC 13 /* reserved range for processor */
-#define STB_HIPROC 15 /* specific symbol bindings */
+#define STB_HIPROC 15 /* specific semantics. */
/* Symbol type - ELFNN_ST_TYPE - st_info */
#define STT_NOTYPE 0 /* Unspecified type. */
#define STT_FUNC 2 /* Function. */
#define STT_SECTION 3 /* Section. */
#define STT_FILE 4 /* Source file. */
-#define STT_COMMON 5 /* Unintialized common block. */
+#define STT_COMMON 5 /* Uninitialized common block. */
#define STT_TLS 6 /* TLS object. */
-#define STT_LOOS 10 /* reserved range for OS specific */
-#define STT_HIOS 12 /* symbol bindings */
+#define STT_LOOS 10 /* Reserved range for operating system */
+#define STT_HIOS 12 /* specific semantics. */
#define STT_LOPROC 13 /* reserved range for processor */
-#define STT_HIPROC 15 /* specific symbol types */
+#define STT_HIPROC 15 /* specific semantics. */
/* Special symbol table indexes. */
#define STN_UNDEF 0 /* Undefined symbol index. */
-/* Symbol visibility flags. */
-#define STV_DEFAULT 0 /* Default symbol visibility. */
-#define STV_INTERNAL 1 /* Processor-specific visibility. */
-#define STV_HIDDEN 2 /* Symbol hidden if not exported. */
-#define STV_PROTECTED 3 /* Not preemptable, not exported. */
+/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */
+#define STV_DEFAULT 0x0 /* Default visibility (see binding). */
+#define STV_INTERNAL 0x1 /* Special meaning in relocatable objects. */
+#define STV_HIDDEN 0x2 /* Not visible. */
+#define STV_PROTECTED 0x3 /* Visible but not preemptible. */
#endif /* !_SYS_ELF_COMMON_H_ */