MIPS section types

From Dmz-portal

Jump to: navigation, search

Contents

Section header Structure

Elf-32 Section header

Name Type Description
sh_name Elf32_Word Section name (index into section header string table section)
sh_type Elf32_Word Section type
sh_flags Elf32_Xword Section flags
sh_addr Elf32_Addr Address o first byte, or zero
sh_offset Elf32_Off File offset of section
sh_size Elf32_Xword Section size in bytes
sh_link Elf32_Word Table index link: section-specific
sh_info Elf32_Word Extra information: section-specific
sh_addralign Elf32_Xword Address alignment constraint
sh_entsize Elf32_Xword Size of fixed-size entries in section, or zero

Elf-64 Section header

Name Type Description
sh_name Elf64_Word Section name (index into section header string table section)
sh_type Elf64_Word Section type
sh_flags Elf64_Xword Section flags
sh_addr Elf64_Addr Address o first byte, or zero
sh_offset Elf64_Off File offset of section
sh_size Elf64_Xword Section size in bytes
sh_link Elf64_Word Table index link: section-specific
sh_info Elf64_Word Extra information: section-specific
sh_addralign Elf64_Xword Address alignment constraint
sh_entsize Elf64_Xword Size of fixed-size entries in section, or zero

Section Types

Generic Types

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


Symbolic Name Type Value Description
SHT_NULL 0 Section header table entry unused
SHT_PROGBITS 1 Program data
SHT_SYMTAB 2 Symbol table
SHT_STRTAB 3 String table
SHT_RELA 4 Relocation entries with addends
SHT_HASH 5 Symbol hash table
SHT_DYNAMIC 6 Dynamic linking information
SHT_NOTE 7 Notes
SHT_NOBITS 8 Program space with no data (bss)
SHT_REL 9 Relocation entries, no addends
SHT_SHLIB 10 Reserved
SHT_DYNSYM 11 Dynamic linker symbol table
SHT_INIT_ARRAY 14 Pointers to initialization functions
SHT_FINI_ARRAY 15 Pointers to termination functions
SHT_PREINIT_ARRAY 16 Pointers to pre-init functions
SHT_GROUP 17 Section group
SHT_SYMTAB_SHNDX 18 Indices for SHN_XINDEX entries

Gnu Types

Symbolic Name Value Description
SHT_GNU_ATTRIBUTES 0x6ffffff5 Object attributes. Tag_GNU_MIPS_ABI_FP (4) for floating point type (See below)
SHT_GNU_HASH 0x6ffffff6 GNU-style hash table
SHT_GNU_LIBLIST 0x6ffffff7 Prelink library list


MIPS_ABI_FP Value Description
Val_GNU_MIPS_ABI_FP_ANY 0 Not tagged or not using any ABIs affected by the differences
Val_GNU_MIPS_ABI_FP_DOUBLE 1 Using hard-float -mdouble-float
Val_GNU_MIPS_ABI_FP_SINGLE 2 Using hard-float -msingle-float
Val_GNU_MIPS_ABI_FP_SOFT 3 Using soft-float
Val_GNU_MIPS_ABI_FP_64 4 Using -mips32r2 -mfp64

Mips Specific Types

Symbolic Name Type Value Description
SHT_MIPS_LIBLIST SHT_LOPROC + 0x00 DSO library information used to link
SHT_MIPS_MSYM SHT_LOPROC + 0x01 MIPS symbol table extension
SHT_MIPS_CONFLICT SHT_LOPROC + 0x02 Symbol conflicting with DSO defined symbols
SHT_MIPS_GPTAB SHT_LOPROC + 0x03 Global pointer table
SHT_MIPS_UCODE SHT_LOPROC + 0x04 Reserved
SHT_MIPS_DEBUG SHT_LOPROC + 0x05 Reserved (obsolete debug information)
SHT_MIPS_REGINFO SHT_LOPROC + 0x06 Register usage information
SHT_MIPS_PACKAGE SHT_LOPROC + 0x07 OSF reserved
SHT_MIPS_PACKSYM SHT_LOPROC + 0x08 OSF reserved
SHT_MIPS_RELD SHT_LOPROC + 0x09 Dynamic relocations (obsolete)
SHT_LOPROC + 0x0a Unused
SHT_MIPS_IFACE SHT_LOPROC + 0x0b Subprogram interface information
SHT_MIPS_CONTENT SHT_LOPROC + 0x0c Section content information
SHT_MIPS_OPTIONS SHT_LOPROC + 0x0d General options
SHT_LOPROC + 0x0e Unused
SHT_LOPROC + 0x0f Unused
SHT_MIPS_SHDR SHT_LOPROC + 0x10 xxx
SHT_MIPS_FDESC SHT_LOPROC + 0x11 xxx
SHT_MIPS_EXTSYM SHT_LOPROC + 0x12 xxx
SHT_MIPS_DENSE SHT_LOPROC + 0x13 xxx
SHT_MIPS_PDESC SHT_LOPROC + 0x14 xxx
SHT_MIPS_LOCSYM SHT_LOPROC + 0x15 xxx
SHT_MIPS_AUXSYM SHT_LOPROC + 0x16 xxx
SHT_MIPS_OPTSYM SHT_LOPROC + 0x17 xxx
SHT_MIPS_LOCSTR SHT_LOPROC + 0x18 xxx
SHT_MIPS_LINE SHT_LOPROC + 0x19 xxx
SHT_MIPS_RFDESC SHT_LOPROC + 0x1a xxx
SHT_MIPS_DELTASYM SHT_LOPROC + 0x1b Delta C++ symbol table (obsolete)
SHT_MIPS_DELTAINST SHT_LOPROC + 0x1c Delta C++ instance table (obsolete)
SHT_MIPS_DELTACLASS SHT_LOPROC + 0x1d Delta C++ class table (obsolete)
SHT_MIPS_DWARF SHT_LOPROC + 0x1e Dwarf debug information
SHT_MIPS_DELTADECL SHT_LOPROC + 0x1f Delta C++ declarations (obsolete)
SHT_MIPS_SYMBOL_LIB SHT_LOPROC + 0x20 Symbol to library mapping
SHT_MIPS_EVENTS SHT_LOPROC + 0x21 Section event mapping
SHT_MIPS_TRANSLATE SHT_LOPROC + 0x22 Old pixie translation table (obsolete)
SHT_MIPS_PIXIE SHT_LOPROC + 0x23 Pixie specific sections (SGI)
SHT_MIPS_XLATE SHT_LOPROC + 0x24 Address translation table
SHT_MIPS_XLATE_DEBUG SHT_LOPROC + 0x25 SGI internal address translation table
SHT_MIPS_WHIRL SHT_LOPROC + 0x26 Intermediate code (MipsPro compiler)
SHT_MIPS_EH_REGION SHT_LOPROC + 0x27 C++ exception handling region information
SHT_MIPS_XLATE_OLD SHT_LOPROC + 0x28 obsolete
SHT_MIPS_PDR_EXCEPTION SHT_LOPROC + 0x29 Runtime procedure descriptor table exception information (ucode)

sh_flags: Section Attribute Flags

Generic Flags

Symbolic Name Type Value Description
SHF_WRITE 0x1 Section writable during execution
SHF_ALLOC 0x2 Section occupies memory
SHF_EXECINSTR 0x4 Section contains executable instructions
SHF_ xxx

MIPS Specific Flags

Symbolic Name Type Value Description
SHF_MIPS_NODUPE 0x01000000 Section contains test/data which may be replicated in other sections. Linker must retain only one copy.
SHF_MIPS_NAMES 0x02000000 Linker must generate implicit hidden weak names
SHF_MIPS_LOCAL 0x04000000 Section data local to process

These sections are for multi-process programs sharing an address space. They must be copied for each process which attempts to write to them. This copying does not occur until after the second process which attempts to write to them. This copying does not occur until after the second process is spawned, so that the initial process can perform dynamic initialization common to all processes' copies of the section. SHF_MIPS_LOCAL is mutually exclusive from SHF_MIPS_GPREL.

SHF_MIPS_NOSTRIP 0x08000000 Section data may not be stripped
SHF_MIPS_GPREL 0x10000000 Section must be part of global data area

SHF_MIPS_GPREL is mutually exclusive from SHF_MIPS_LOCAL.

SHF_MIPS_MERGE 0x20000000 Section data should be merged to eliminate duplication

For a merged section, the SH_INFO value is the size (in bytes) of the objects to be merged. Such sections should not be writable.

SHF_MIPS_ADDR 0x40000000 Section data is addresses by default. Address size to be inferred from section entry size.
SHF_MIPS_STRING 0x80000000 Section data is string data by default
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox