Add GABI constants for DT_*

This commit is contained in:
Christopher Cole 2022-10-21 17:08:05 -07:00
parent 3d0a090ab2
commit 969bb74628
No known key found for this signature in database
GPG Key ID: 0AC856975983E9DB

View File

@ -602,3 +602,144 @@ pub const STV_HIDDEN: u8 = 2;
/// in that component, even if there is a definition in another component that
/// would preempt by the default rules.
pub const STV_PROTECTED: u8 = 3;
/// An entry with a DT_NULL tag marks the end of the _DYNAMIC array.
pub const DT_NULL: u64 = 0;
/// This element holds the string table offset of a null-terminated string,
/// giving the name of a needed library. The offset is an index into the table
/// recorded in the DT_STRTAB code. The dynamic array may contain multiple
/// entries with this type. These entries' relative order is significant, though
/// their relation to entries of other types is not.
pub const DT_NEEDED: u64 = 1;
/// This element holds the total size, in bytes, of the relocation entries
/// associated with the procedure linkage table. If an entry of type DT_JMPREL
/// is present, a DT_PLTRELSZ must accompany it.
pub const DT_PLTRELSZ: u64 = 2;
/// This element holds an address associated with the procedure linkage table
/// and/or the global offset table.
pub const DT_PLTGOT: u64 = 3;
/// This element holds the address of the symbol hash table. This hash table
/// refers to the symbol table referenced by the DT_SYMTAB element.
pub const DT_HASH: u64 = 4;
/// This element holds the address of the string table. Symbol names, library
/// names, and other strings reside in this table.
pub const DT_STRTAB: u64 = 5;
/// This element holds the address of the symbol table.
pub const DT_SYMTAB: u64 = 6;
/// This element holds the address of a relocation table. Entries in the table
/// have explicit addends, (Rela). An object file may have multiple relocation
/// sections. When building the relocation table for an executable or shared
/// object file, the link editor catenates those sections to form a single
/// table. Although the sections remain independent in the object file, the
/// dynamic linker sees a single table. When the dynamic linker creates the
/// process image for an executable file or adds a shared object to the process
/// image, it reads the relocation table and performs the associated actions.
/// If this element is present, the dynamic structure must also have DT_RELASZ
/// and DT_RELAENT elements. When relocation is mandatory for a file, either
/// DT_RELA or DT_REL may occur (both are permitted but not required).
pub const DT_RELA: u64 = 7;
/// This element holds the total size, in bytes, of the DT_RELA relocation table.
pub const DT_RELASZ: u64 = 8;
/// This element holds the size, in bytes, of the DT_RELA relocation entry.
pub const DT_RELAENT: u64 = 9;
/// This element holds the size, in bytes, of the string table.
pub const DT_STRSZ: u64 = 10;
/// This element holds the size, in bytes, of a symbol table entry.
pub const DT_SYMENT: u64 = 11;
/// This element holds the address of the initialization function.
pub const DT_INIT: u64 = 12;
/// This element holds the address of the termination function.
pub const DT_FINI: u64 = 13;
/// This element holds the string table offset of a null-terminated string,
/// giving the name of the shared object. The offset is an index into the table
/// recorded in the DT_STRTAB entry.
pub const DT_SONAME: u64 = 14;
/// This element holds the string table offset of a null-terminated search
/// library search path string. The offset is an index into the table recorded
/// in the DT_STRTAB entry. Its use has been superseded by DT_RUNPATH.
pub const DT_RPATH: u64 = 15;
/// This element's presence in a shared object library alters the dynamic
/// linker's symbol resolution algorithm for references within the library.
/// Instead of starting a symbol search with the executable file, the dynamic
/// linker starts from the shared object itself. If the shared object fails to
/// supply the referenced symbol, the dynamic linker then searches the
/// executable file and other shared objects as usual. Its use has been
/// superseded by the DF_SYMBOLIC flag.
pub const DT_SYMBOLIC: u64 = 16;
/// This element is similar to DT_RELA, except its table has implicit addends (Rel).
/// If this element is present, the dynamic structure must also have DT_RELSZ
/// and DT_RELENT elements.
pub const DT_REL: u64 = 17;
/// This element holds the total size, in bytes, of the DT_REL relocation table.
pub const DT_RELSZ: u64 = 18;
/// This element holds the size, in bytes, of the DT_REL relocation entry.
pub const DT_RELENT: u64 = 19;
/// This member specifies the type of relocation entry to which the procedure
/// linkage table refers. The d_val member holds DT_REL or DT_RELA, as
/// appropriate. All relocations in a procedure linkage table must use the same
/// relocation.
pub const DT_PLTREL: u64 = 20;
/// This member is used for debugging. Its contents are not specified for the
/// ABI; programs that access this entry are not ABI-conforming.
pub const DT_DEBUG: u64 = 21;
/// This member's absence signifies that no relocation entry should cause a
/// modification to a non-writable segment, as specified by the segment
/// permissions in the program header table. If this member is present, one or
/// more relocation entries might request modifications to a non-writable
/// segment, and the dynamic linker can prepare accordingly. Its use has been
/// superseded by the DF_TEXTREL flag.
pub const DT_TEXTREL: u64 = 22;
/// If present, this entry's d_ptr member holds the address of relocation
/// entries associated solely with the procedure linkage table. Separating these
/// relocation entries lets the dynamic linker ignore them during process
/// initialization, if lazy binding is enabled. If this entry is present, the
/// related entries of types DT_PLTRELSZ and DT_PLTREL must also be present.
pub const DT_JMPREL: u64 = 23;
/// If present in a shared object or executable, this entry instructs the
/// dynamic linker to process all relocations for the object containing this
/// entry before transferring control to the program. The presence of this entry
/// takes precedence over a directive to use lazy binding for this object when
/// specified through the environment or via dlopen(BA_LIB). Its use has been
/// superseded by the DF_BIND_NOW flag.
pub const DT_BIND_NOW: u64 = 24;
/// This element holds the address of the array of pointers to initialization functions.
pub const DT_INIT_ARRAY: u64 = 25;
/// This element holds the address of the array of pointers to termination functions.
pub const DT_FINI_ARRAY: u64 = 26;
/// This element holds the size in bytes of the array of initialization
/// functions pointed to by the DT_INIT_ARRAY entry. If an object has a
/// DT_INIT_ARRAY entry, it must also have a DT_INIT_ARRAYSZ entry.
pub const DT_INIT_ARRAYSZ: u64 = 27;
/// This element holds the size in bytes of the array of termination functions
/// pointed to by the DT_FINI_ARRAY entry. If an object has a DT_FINI_ARRAY
/// entry, it must also have a DT_FINI_ARRAYSZ entry.
pub const DT_FINI_ARRAYSZ: u64 = 28;
/// This element holds the string table offset of a null-terminated library
/// search path string. The offset is an index into the table recorded in the
/// DT_STRTAB entry.
pub const DT_RUNPATH: u64 = 29;
/// This element holds flag values specific to the object being loaded. Each
/// flag value will have the name DF_flag_name. Defined values and their
/// meanings are described below. All other values are reserved.
pub const DT_FLAGS: u64 = 30;
/// This element holds the address of the array of pointers to
/// pre-initialization functions. The DT_PREINIT_ARRAY table is processed only
/// in an executable file; it is ignored if contained in a shared object.
pub const DT_PREINIT_ARRAY: u64 = 32;
/// This element holds the size in bytes of the array of pre-initialization
/// functions pointed to by the DT_PREINIT_ARRAY entry. If an object has a
/// DT_PREINIT_ARRAY entry, it must also have a DT_PREINIT_ARRAYSZ entry. As
/// with DT_PREINIT_ARRAY, this entry is ignored if it appears in a shared
/// object.
pub const DT_PREINIT_ARRAYSZ: u64 = 33;
/// This element holds the address of the SHT_SYMTAB_SHNDX section associated
/// with the dynamic symbol table referenced by the DT_SYMTAB element.
pub const DT_SYMTAB_SHNDX: u64 = 34;
/// Values in [DT_LOOS, DT_HIOS] are reserved for operating system-specific semantics.
pub const DT_LOOS: u64 = 0x6000000D;
/// Values in [DT_LOOS, DT_HIOS] are reserved for operating system-specific semantics.
pub const DT_HIOS: u64 = 0x6ffff000;
/// Values in [DT_LOPROC, DT_HIPROC] are reserved for processor-specific semantics.
pub const DT_LOPROC: u64 = 0x70000000;
/// Values in [DT_LOPROC, DT_HIPROC] are reserved for processor-specific semantics.
pub const DT_HIPROC: u64 = 0x7fffffff;