MIPS Dynamic

From Dmz-portal

Jump to: navigation, search

Contents

Dynamic Tags

typedef struct {
   Elf32_Sword		d_tag;
   union {
       Elf32_Word	d_val;
       Elf32_Addr	d_ptr;
       } d_un;
} Elf32_Dyn;
typedef struct {
       Elf64_Sxword	d_tag;
       union {
            Elf64_Xword	d_val;
            Elf64_Addr	d_ptr;
       } d_un;
} Elf64_Dyn;

Dynamic Tag Types (d_un)

Symbol Description
d_val Numeric value
d_ptr Virtual Address

Keys

Symbol Description
O Optional
R Required
I Ignore
U Unspecified

Generic Dynamic Table

See http://www.sco.com/developers/gabi for more details of gABI descriptions

Name Value Type A.OUT DSO
DT_NULL 0 I M M
DT_NEEDED 1 d_val O O
DT_PLTRELSZ 2 d_val O O
DT_PLTGOT 3 d_ptr O O
DT_HASH 4 d_ptr M M
DT_STRTAB 5 d_ptr M M
DT_SYMTAB 6 d_ptr M M
DT_RELA 7 d_ptr M O
DT_RELASZ 8 d_val M O
DT_RELAENT 9 d_val M O
DT_STRSZ 10 d_val M M
DT_SYMENT 11 d_val M M
DT_INIT 12 d_ptr O O
DT_FINI 13 d_ptr O O
DT_SONAME 14 d_val I O
DT_RPATH 15 d_val O I
DT_SYMBOLIC 16 I I O
DT_REL 17 d_ptr M O
DT_RELSZ 18 d_val M O
DT_RELENT 19 d_val M O
DT_PLTREL 20 d_val O O
DT_DEBUG 21 d_ptr O I
DT_TEXTREL 22 I O O
DT_JMPREL 23 d_ptr O O
DT_BIND_NOW 24 I O O
DT_INIT_ARRAY 25 d_ptr O O
DT_FINI_ARRAY 26 d_ptr O O
DT_INIT_ARRAYSZ 27 d_val O O
DT_FINI_ARRAYSZ 28 d_val O O
DT_RUNPATH 29 d_val O O
DT_FLAGS 30 d_val O O
DT_ENCODING 31 U U U
DT_PREINIT_ARRAY 32 d_ptr O I
DT_PREINIT_ARRAYSZ 33 d_val O I

MIPS Specific Dynamic Table

Name Value Type Exec Action DSO Action
DT_MIPS_RLD_VERSION 0x70000001 d_val M M
DT_MIPS_TIME_STAMP 0x70000002 d_val O O
DT_DT_MIPS_ICHECKSUM _ 0x70000003 d_val O O
DT_MIPS_IVERSION 0x70000004 d_val O O
DT_MIPS_FLAGS 0x70000005 d_val M M
DT_MIPS_BASE_ADDRESS 0x70000006 d_ptr M M
DT_MIPS_MSYM 0x70000007 d_ptr O O
DT_MIPS_CONFLICT 0x70000008 d_ptr O O
DT_MIPS_LIBLIST 0x70000009 d_ptr O O
DT_MIPS_LOCAL_GOTNO 0x7000000a d_val M M
DT_MIPS_CONFLICTNO 0x7000000b d_val O O
DT_MIPS_LIBLISTNO 0x70000010 d_val O O
DT_MIPS_SYMTABNO 0x70000011 d_val M M
DT_MIPS_UNREFEXTNO 0x70000012 d_val O O
DT_MIPS_GOTSYM 0x70000013 d_val M M
DT_MIPS_HIPAGENO 0x70000014 d_val O O
DT_MIPS_RLD_MAP 0x70000016 d_val O O
DT_MIPS_DELTA_CLASS 0x70000017 d_val O O
DT_MIPS_DELTA_CLASS_NO 0x70000018 d_val O O
DT_MIPS_DELTA_INSTANCE 0x70000019 d_val O O
DT_MIPS_DELTA_INSTANCE_NO 0x7000001a d_val O O
DT_MIPS_DELTA_RELOC 0x7000001b d_val O O
DT_MIPS_DELTA_RELOC_NO 0x7000001c d_val O O
DT_MIPS_DELTA_SYM 0x7000001d d_val O O
DT_MIPS_DELTA_SYM_NO 0x7000001e d_val O O
DT_MIPS_DELTA_CLASSSYM 0x70000020 d_val O O
DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 d_val O O
DT_MIPS_CXX_FLAGS 0x70000022 d_val O O
DT_MIPS_PIXIE_INIT 0x70000023 d_val O O
DT_MIPS_SYMBOL_LIB 0x70000024 d_val O O
DT_MIPS_LOCALPAGE_GOTIDX 0x70000025 d_val O O
DT_MIPS_LOCAL_GOTIDX 0x70000026 d_val O O
DT_MIPS_HIDDEN_GOTIDX 0x70000027 d_val O O
DT_MIPS_PROTECTED_GOTIDX 0x70000028 d_val O O
DT_MIPS_OPTIONS 0x70000029 d_ptr M M
DT_MIPS_INTERFACE 0x7000002a d_ptr O O
DT_MIPS_DYNSTR_ALIGN 0x7000002b d_val O O
DT_MIPS_INTERFACE_SIZE 0x7000002c d_val O O
DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d d_ptr O O
DT_MIPS_PERF_SUFFIX 0x7000002e d_val O O
DT_MIPS_COMPACT_SIZE 0x7000002f d_val O O
DT_MIPS_GP_VALUE 0x70000030 d_ptr O O
DT_MIPS_AUX_DYNAMIC 0x70000031 d_ptr O O
DT_MIPS_DIRECT (SGI)

DT_MIPS_PLTGOT (GNU)

0x70000032 d_val O O
DT_MIPS_RLD_OBJ_UPDATE 0x70000033 d_val O O
DT_MIPS_RWPLT 0x70000034 d_val O O

Dynamic Tag Detail

DT_NULL

This tag must terminate the list of dynamic section tags.

DT_NEEDED

This is a string table offset of a required library’s name.

There must be such an entry for each required DSO.

DT_PLTRELSZ

This member gives the total byte size of the relocation entries associated with the PLT (.rel.plt). Mandatory if DT_JMPREL is present.

DT_PLTGOT

This member has the address of the .got section. It is mandatory for MIPS executables and DSOs. (A completely non-shared executable with no DSO dependencies might have no GOT, but ABI compliance requires use of the libc DSO.)

DT_HASH

This member gives the symbol hash table address.

DT_STRTAB

This member gives the string table address (the .dynstr section). The string table contains symbol names, library names, and other strings required in the executable/DSO.

DT_SYMTAB

This member gives the symbol table address (the .dynsym section). All entries in a 64-bit file are Elf64_Sym type. All entries in a 32-bit file are Elf32_Sym type.

DT_RELA

This member gives the address of a relocation table with entry type Elf64_Rela (see Table 29). Elf-64 executables will normally use this type of relocation because it is required for some of the relocation types (e.g. R_MIPS_HI16), but an ABI-compliant system must cope with Elf64_Rel tables as well.

DT_RELASZ

This member gives the byte size of the DT_RELA table.

DT_RELAENT

This member gives the byte size of a DT_RELA entry.

DT_STRSZ

This member gives the byte size of the DT_STRTAB table.

DT_SYMENT

This member gives the byte size of a DT_SYMTAB entry.

DT_INIT

DT_FINI

DT_SONAME

This member gives the string table offset of the containing DSO’s name.

DT_RPATH

This member gives the string table offset of a shared library search path. If it is present in a referenced DSO at static link time, it is included in the final executable’s DT_RPATH.

DT_SYMBOLIC

This member, if present, causes references within the containing DSO to be resolved locally if possible (i.e. it makes them all non-preemptible).

DT_REL

This member gives the address of a relocation table with entry type Elf64_Rel.

DT_RELSZ

This member gives the byte size of the DT_REL table.

DT_RELENT

This member gives the byte size of a DT_RELA entry.

DT_PLTREL

This member gives the kind of relocation (DT_RELA or DT_REL) in the procedure linkage table.

DT_DEBUG

This member is used for debugging. Its contents are not specified for the ABI; programs that access this entry are not ABI-conforming.

DT_TEXTREL

This member, if absent, implies that runtime relocations will not change a non-writable segment.

DT_JMPREL

This member gives the address of relocation entries associated solely with the procedure linkage table. If present, DT_PLTREL and DT_PLTRELSZ are also required.

It points to the first jump-slot relocation in the dynamic relocation table (i.e. the base of .rel.plt).

DT_BIND_NOW

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). This entry is at level 2. Its use has been superseded by the DF_BIND_NOW flag.

DT_INIT_ARRAY

This element holds the address of the array of pointers to initialization functions.

DT_FINI_ARRAY

DT_INIT_ARRAYSZ

DT_FINI_ARRAYSZ

DT_RUNPATH

DT_FLAGS

DT_ENCODING

DT_PREINIT_ARRAY

DT_PREINIT_ARRAYSZ

DT_MIPS_RLD_VERSION

This member gives a version ID for the Runtime Linker Interface.

DT_MIPS_TIME_STAMP

This member gives a timestamp.

DT_MIPS_ICHECKSUM

This member gives a checksum of all external strings (names?) and common sizes.

DT_MIPS_IVERSION

This member gives the string table index of a compatible version string.

DT_MIPS_FLAGS

This member contains MIPS-specific flags (see below).

DT_MIPS_BASE_ADDRESS

This member contains the base address assumed for the executable/DSO at static link time. It is used to adjust addresses (e.g. in the GOT) when a DSO is relocated at runtime. It is the preferred address for quickstart purposes.

DT_MIPS_MSYM

DT_MIPS_CONFLICT

This member contains the address of the .conflict section. It is mandatory if there is a .conflict section.

DT_MIPS_LIBLIST

This member contains the address of the .liblist section.

DT_MIPS_LOCAL_GOTNO

This member contains the number of local GOT entries.

DT_MIPS_CONFLICTNO

This member contains the number of entries in the .conflict section. It is mandatory if DT_MIPS_CONFLICT is present.

DT_MIPS_LIBLISTNO

This member contains the number of entries in the .liblist section. It is required if DT_MIPS_LIBLIST is present.

DT_MIPS_SYMTABNO

This member contains the number of entries in the .dynsym section.

DT_MIPS_UNREFEXTNO

This member contains the index into the dynamic symbol table of the first external symbol that is not referenced in the same object.

DT_MIPS_GOTSYM

This member contains the index into the dynamic symbol table of the first entry that corresponds to an external symbol with an entry in the GOT.

DT_MIPS_HIPAGENO

This member contains the number of page table entries in the GOT. It is used by profiling tools and is optional.

DT_MIPS_RLD_MAP

Contains a writeable address for debugger use. An indirect version of DT_DEBUG

Often the dynamic section is mapped into the readonly segment. This is too include it in the first page read for processing and linkage decisions. If this is readonly we cannot use the traditional DT_DEBUG. DT_MIPS_RLD_MAP contains the address of the writeable location for debugging use.

DT_MIPS_DELTA_CLASS

DT_MIPS_DELTA_CLASS_NO

DT_MIPS_DELTA_INSTANCE

DT_MIPS_DELTA_INSTANCE_NO

DT_MIPS_DELTA_RELOC_

DT_MIPS_DELTA_RELOC_NO

DT_MIPS_DELTA_SYM

DT_MIPS_DELTA_SYM_NO

DT_MIPS_DELTA_CLASSSYM

DT_MIPS_DELTA_CLASSSYM_NO

DT_MIPS_CXX_FLAGS

DT_MIPS_PIXIE_INIT

This member contains the address of an initialization routine created by pixie. (DT_INIT cannot be used for this purpose is because pixie depends on a specific order for its initialization routines, which is different from the ABI-specified DT_INIT order.

DT_MIPS_SYMBOL_LIB

This optional member contains the address of the .MIPS.symlib section, describing a mapping from the .dynsym symbols to the DSOs where they are defined.

DT_MIPS_LOCALPAGE_GOTIDX

This member contains the index in the GOT of the first page table entry for a segment. There will be one per segment, in the same order as the segments in the segment table. They are mandatory if there are page table entries for any segment, and the value for a segment without any page table entries must be zero.

DT_MIPS_LOCAL_GOTIDX

This member contains the index in the GOT of the first entry for a local symbol. It is mandatory if there are local symbol entries.

DT_MIPS_HIDDEN_GOTIDX

This member contains the index in the GOT of the first entry for a hidden symbol. It is mandatory if there are hidden symbol entries.

DT_MIPS_PROTECTED_GOTIDX

This member contains the index in the GOT of the first entry for a protected symbol. It is mandatory if there are protected symbol entries.

DT_MIPS_OPTIONS

This member contains the address of the Options section, containing various execution options. It is mandatory.

DT_MIPS_INTERFACE

This member contains the address of the .MIPS.interface section, describing subprogram interfaces. It is mandatory if there is such a section in the executable/DSO.

DT_MIPS_DYNSTR_ALIGN

DT_MIPS_INTERFACE_SIZE

This member contains the size in bytes of the .MIPS.interface section. It is mandatory if there is such a section in the executable/DSO.

DT_MIPS_RLD_TEXT_RESOLVE_ADDR

If present, this member contains the link-time address of _rld_text_resolve to place in GOT entry 0. If absent (or if present and the value is not the same as the address in rld of the _rld_text_resolve function), then rld places the true address of _rld_text_resolve into GOT entry 0 at run-time.

DT_MIPS_PERF_SUFFIX

This member contains an index to the string table. Rld appends the specified string to the shared object name specified in any dlopen calls. (For example, pixie creates binaries and shared objects with suffix ".pixie". Although it changes the shared objects in the liblist of an object to include the correct suffix, it cannot change the pathnames passed by the program to dlopen.)

DT_MIPS_COMPACT_SIZE

This member contains the size of a ucode compact relocation header record, and is not present in -n32 or -64 ELF files.

DT_MIPS_GP_VALUE

This member contains the GP value of a specific GP relative range. This is used with multigot and is dynamic table order sensitive.

DT_MIPS_AUX_DYNAMIC

This member contains the address of an auxiliary dynamic table in the case of multigot. The order of these records should correspind to the order of the DT_MIPS_GP_VALUE records as the latter contain the GP value representing the corresponding dynamic table.

DT_MIPS_DIRECT/DT_MIPS_PLTGOT

DT_MIPS_DIRECT (SGI): If this member exists it tells the runtime linker (rld) that the .symlib section is fully filled out and preemption is not used. This does not affect normal resolution of UNDEF symbols.

DT_MIPS_PLTGOT (GNU): The address of .got.plt in an executable using the new non-PIC ABI. This is needed because it may not be contiguous with the traditional GOT (.got section). The standard DT_PLTGOT entry points to the base of the GOT.

DT_MIPS_RLD_OBJ_UPDATE

This member gives the dynamic symbol entry of a callback function defined in this dso/a.out. The callback function is called by rld whenever a change to it’s object list has occured, usually through dynamic open and close operations. This callback function has a void type and has one integer parameter.

void (*)(int version)
where version == 1

No particular function name is required. Rld will call whatever symbol is referenced by the .dynsym index. It is suggested, but not required that the symbol be marked STO_HIDDEN and should never be called by anyone other than rld. The symbol should however be marked STT_FUNC. The symbol must not be SHN_ABS, SHN_COMMON or SHN_UNDEF. It must be a defined symbol in the DSO/a.out with DT_MIPS_RLD_OBJ_UPDATE set.

DT_MIPS_RWPLT

The base of the PLT in an executable using the new non-PIC ABI if that PLT is writable. For a non-writable PLT, this is omitted or has a zero value.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox