xcoff
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package xcoff implements access to XCOFF (Extended Common Object File Format) files.
Index¶
- Constants
- type Archive
- type ArchiveHeader
- type AuxCSect32
- type AuxCSect64
- type AuxFcn32
- type AuxFcn64
- type AuxFile64
- type AuxSect64
- type AuxiliaryCSect
- type AuxiliaryFcn
- type File
- func (f *File) CSect(name string) []byte
- func (f *File) Close() error
- func (f *File) DWARF() (*dwarf.Data, error)
- func (f *File) ImportedLibraries() ([]string, error)
- func (f *File) ImportedSymbols() ([]ImportedSymbol, error)
- func (f *File) Section(name string) *Section
- func (f *File) SectionByType(typ uint32) *Section
- type FileHeader
- type FileHeader32
- type FileHeader64
- type ImportedSymbol
- type LoaderHeader32
- type LoaderHeader64
- type LoaderSymbol32
- type LoaderSymbol64
- type Member
- type MemberHeader
- type Reloc
- type Reloc32
- type Reloc64
- type Section
- type SectionHeader
- type SectionHeader32
- type SectionHeader64
- type SymEnt32
- type SymEnt64
- type Symbol
Constants¶
const (SAIAMAG = 0x8AIAFMAG = "`\n"AIAMAG = "<aiaff>\n"AIAMAGBIG = "<bigaf>\n"// SizeofFL_HSZ_BIG = 0x80AR_HSZ_BIG = 0x70)
const (FILHSZ_32 = 20FILHSZ_64 = 24)
const (U802TOCMAGIC = 0737// AIX 32-bit XCOFFU64_TOCMAGIC = 0767// AIX 64-bit XCOFF)
const (F_RELFLG = 0x0001F_EXEC = 0x0002F_LNNO = 0x0004F_FDPR_PROF = 0x0010F_FDPR_OPTI = 0x0020F_DSA = 0x0040F_VARPG = 0x0100F_DYNLOAD = 0x1000F_SHROBJ = 0x2000F_LOADONLY = 0x4000)
Flags that describe the type of the object file.
const (STYP_DWARF = 0x0010STYP_TEXT = 0x0020STYP_DATA = 0x0040STYP_BSS = 0x0080STYP_EXCEPT = 0x0100STYP_INFO = 0x0200STYP_TDATA = 0x0400STYP_TBSS = 0x0800STYP_LOADER = 0x1000STYP_DEBUG = 0x2000STYP_TYPCHK = 0x4000STYP_OVRFLO = 0x8000)
Flags defining the section type.
const (SSUBTYP_DWINFO = 0x10000// DWARF info sectionSSUBTYP_DWLINE = 0x20000// DWARF line-number sectionSSUBTYP_DWPBNMS = 0x30000// DWARF public names sectionSSUBTYP_DWPBTYP = 0x40000// DWARF public types sectionSSUBTYP_DWARNGE = 0x50000// DWARF aranges sectionSSUBTYP_DWABREV = 0x60000// DWARF abbreviation sectionSSUBTYP_DWSTR = 0x70000// DWARF strings sectionSSUBTYP_DWRNGES = 0x80000// DWARF ranges sectionSSUBTYP_DWLOC = 0x90000// DWARF location lists sectionSSUBTYP_DWFRAME = 0xA0000// DWARF frames sectionSSUBTYP_DWMAC = 0xB0000// DWARF macros section)
const (// NscnumN_DEBUG = -2N_ABS = -1N_UNDEF = 0//NtypeSYM_V_INTERNAL = 0x1000SYM_V_HIDDEN = 0x2000SYM_V_PROTECTED = 0x3000SYM_V_EXPORTED = 0x4000SYM_TYPE_FUNC = 0x0020// is function)
const (C_NULL = 0// Symbol table entry marked for deletionC_EXT = 2// External symbolC_STAT = 3// Static symbolC_BLOCK = 100// Beginning or end of inner blockC_FCN = 101// Beginning or end of functionC_FILE = 103// Source file name and compiler informationC_HIDEXT = 107// Unnamed external symbolC_BINCL = 108// Beginning of include fileC_EINCL = 109// End of include fileC_WEAKEXT = 111// Weak external symbolC_DWARF = 112// DWARF symbolC_GSYM = 128// Global variableC_LSYM = 129// Automatic variable allocated on stackC_PSYM = 130// Argument to subroutine allocated on stackC_RSYM = 131// Register variableC_RPSYM = 132// Argument to function or procedure stored in registerC_STSYM = 133// Statically allocated symbolC_BCOMM = 135// Beginning of common blockC_ECOML = 136// Local member of common blockC_ECOMM = 137// End of common blockC_DECL = 140// Declaration of objectC_ENTRY = 141// Alternate entryC_FUN = 142// Function or procedureC_BSTAT = 143// Beginning of static blockC_ESTAT = 144// End of static blockC_GTLS = 145// Global thread-local variableC_STTLS = 146// Static thread-local variable)
Storage Class.
const (XTY_ER = 0// External referenceXTY_SD = 1// Section definitionXTY_LD = 2// Label definitionXTY_CM = 3// Common csect definition)
Symbol type field.
const (XFT_FN = 0// Source File NameXFT_CT = 1// Compile Time StampXFT_CV = 2// Compiler Version NumberXFT_CD = 128// Compiler Defined Information)
Defines for File auxiliary definitions: x_ftype field of x_file
const (XMC_PR = 0// Program codeXMC_RO = 1// Read-only constantXMC_DB = 2// Debug dictionary tableXMC_TC = 3// TOC entryXMC_UA = 4// UnclassifiedXMC_RW = 5// Read/Write dataXMC_GL = 6// Global linkageXMC_XO = 7// Extended operationXMC_SV = 8// 32-bit supervisor call descriptorXMC_BS = 9// BSS classXMC_DS = 10// Function descriptorXMC_UC = 11// Unnamed FORTRAN commonXMC_TC0 = 15// TOC anchorXMC_TD = 16// Scalar data entry in the TOCXMC_SV64 = 17// 64-bit supervisor call descriptorXMC_SV3264 = 18// Supervisor call descriptor for both 32-bit and 64-bitXMC_TL = 20// Read/Write thread-local dataXMC_UL = 21// Read/Write thread-local data (.tbss)XMC_TE = 22// TOC entry)
Storage-mapping class.
const (LDHDRSZ_32 = 32LDHDRSZ_64 = 56)
const (R_POS = 0x00// A(sym) Positive RelocationR_NEG = 0x01// -A(sym) Negative RelocationR_REL = 0x02// A(sym-*) Relative to selfR_TOC = 0x03// A(sym-TOC) Relative to TOCR_TRL = 0x12// A(sym-TOC) TOC Relative indirect load.R_TRLA = 0x13// A(sym-TOC) TOC Rel load address. modifiable instR_GL = 0x05// A(external TOC of sym) Global LinkageR_TCL = 0x06// A(local TOC of sym) Local object TOC addressR_RL = 0x0C// A(sym) Pos indirect load. modifiable instructionR_RLA = 0x0D// A(sym) Pos Load Address. modifiable instructionR_REF = 0x0F// AL0(sym) Non relocating ref. No garbage collectR_BA = 0x08// A(sym) Branch absolute. Cannot modify instructionR_RBA = 0x18// A(sym) Branch absolute. modifiable instructionR_BR = 0x0A// A(sym-*) Branch rel to self. non modifiableR_RBR = 0x1A// A(sym-*) Branch rel to self. modifiable instrR_TLS = 0x20// General-dynamic reference to TLS symbolR_TLS_IE = 0x21// Initial-exec reference to TLS symbolR_TLS_LD = 0x22// Local-dynamic reference to TLS symbolR_TLS_LE = 0x23// Local-exec reference to TLS symbolR_TLSM = 0x24// Module reference to TLS symbolR_TLSML = 0x25// Module reference to local (own) moduleR_TOCU = 0x30// Relative to TOC - high order bitsR_TOCL = 0x31// Relative to TOC - low order bits)
const SYMESZ = 18Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeArchive¶
type Archive struct {ArchiveHeaderMembers []*Member// contains filtered or unexported fields}Archive represents an open AIX big archive.
funcNewArchive¶
NewArchive creates a new Archive for accessing an AIX big archive in an underlying reader.
funcOpenArchive¶
OpenArchive opens the named archive using os.Open and prepares it for useas an AIX big archive.
typeArchiveHeader¶
type ArchiveHeader struct {// contains filtered or unexported fields}ArchiveHeader holds information about a big archive file header
typeAuxCSect32¶
type AuxCSect32 struct {Xscnlenuint32// Length or symbol table indexXparmhashuint32// Offset of parameter type-check stringXsnhashuint16// .typchk section numberXsmtypuint8// Symbol alignment and typeXsmclasuint8// Storage-mapping classXstabuint32// ReservedXsnstabuint16// Reserved}csect Auxiliary Entry.
typeAuxCSect64¶
type AuxCSect64 struct {Xscnlenlouint32// Lower 4 bytes of length or symbol table indexXparmhashuint32// Offset of parameter type-check stringXsnhashuint16// .typchk section numberXsmtypuint8// Symbol alignment and typeXsmclasuint8// Storage-mapping classXscnlenhiuint32// Upper 4 bytes of length or symbol table indexXpaduint8// UnusedXauxtypeuint8// Type of auxiliary entry}typeAuxFcn32¶
type AuxFcn32 struct {Xexptruint32// File offset to exception table entryXfsizeuint32// Size of function in bytesXlnnoptruint32// File pointer to line numberXendndxuint32// Symbol table index of next entryXpaduint16// Unused}Function Auxiliary Entry
typeAuxFile64¶
type AuxFile64 struct {Xfname [8]byte// Name or offset inside string tableXftypeuint8// Source file string typeXauxtypeuint8// Type of auxiliary entry}File Auxiliary Entry
typeAuxiliaryCSect¶
AuxiliaryCSect holds information about an XCOFF symbol in an AUX_CSECT entry.
typeAuxiliaryFcn¶
type AuxiliaryFcn struct {Sizeint64}AuxiliaryFcn holds information about an XCOFF symbol in an AUX_FCN entry.
typeFile¶
type File struct {FileHeaderSections []*SectionSymbols []*SymbolStringTable []byteLibraryPaths []string// contains filtered or unexported fields}A File represents an open XCOFF file.
func (*File)Close¶
Close closes the File.If the File was created using NewFile directly instead of Open,Close has no effect.
func (*File)ImportedLibraries¶
ImportedLibraries returns the names of all librariesreferred to by the binary f that are expected to belinked with the binary at dynamic link time.
func (*File)ImportedSymbols¶
func (f *File) ImportedSymbols() ([]ImportedSymbol,error)
ImportedSymbols returns the names of all symbolsreferred to by the binary f that are expected to besatisfied by other libraries at dynamic load time.It does not return weak symbols.
func (*File)Section¶
Section returns the first section with the given name, or nil if no suchsection exists.Xcoff have section's name limited to 8 bytes. Some sections like .gosymtabcan be trunked but this method will still find them.
func (*File)SectionByType¶
SectionByType returns the first section in f with thegiven type, or nil if there is no such section.
typeFileHeader¶
type FileHeader struct {TargetMachineuint16}FileHeader holds information about an XCOFF file header.
typeFileHeader32¶
type FileHeader32 struct {Fmagicuint16// Target machineFnscnsuint16// Number of sectionsFtimedatuint32// Time and date of file creationFsymptruint32// Byte offset to symbol table startFnsymsuint32// Number of entries in symbol tableFopthdruint16// Number of bytes in optional headerFflagsuint16// Flags}File Header.
typeFileHeader64¶
type FileHeader64 struct {Fmagicuint16// Target machineFnscnsuint16// Number of sectionsFtimedatuint32// Time and date of file creationFsymptruint64// Byte offset to symbol table startFopthdruint16// Number of bytes in optional headerFflagsuint16// FlagsFnsymsuint32// Number of entries in symbol table}typeImportedSymbol¶
ImportedSymbol holds information about an imported XCOFF symbol.
typeLoaderHeader32¶
type LoaderHeader32 struct {Lversionuint32// Loader section version numberLnsymsuint32// Number of symbol table entriesLnrelocuint32// Number of relocation table entriesListlenuint32// Length of import file ID string tableLnimpiduint32// Number of import file IDsLimpoffuint32// Offset to start of import file IDsLstlenuint32// Length of string tableLstoffuint32// Offset to start of string table}Loader Header.
typeLoaderHeader64¶
type LoaderHeader64 struct {Lversionuint32// Loader section version numberLnsymsuint32// Number of symbol table entriesLnrelocuint32// Number of relocation table entriesListlenuint32// Length of import file ID string tableLnimpiduint32// Number of import file IDsLstlenuint32// Length of string tableLimpoffuint64// Offset to start of import file IDsLstoffuint64// Offset to start of string tableLsymoffuint64// Offset to start of symbol tableLrldoffuint64// Offset to start of relocation entries}typeLoaderSymbol32¶
type LoaderSymbol32 struct {Lname [8]byte// Symbol name or byte offset into string tableLvalueuint32// Address fieldLscnumuint16// Section number containing symbolLsmtypeuint8// Symbol type, export, import flagsLsmclasuint8// Symbol storage classLifileuint32// Import file ID; ordinal of import file IDsLparmuint32// Parameter type-check field}Loader Symbol.
typeLoaderSymbol64¶
type LoaderSymbol64 struct {Lvalueuint64// Address fieldLoffsetuint32// Byte offset into string table of symbol nameLscnumuint16// Section number containing symbolLsmtypeuint8// Symbol type, export, import flagsLsmclasuint8// Symbol storage classLifileuint32// Import file ID; ordinal of import file IDsLparmuint32// Parameter type-check field}typeMember¶
type Member struct {MemberHeader// contains filtered or unexported fields}Member represents a member of an AIX big archive.
typeMemberHeader¶
MemberHeader holds information about a big archive member
typeSection¶
type Section struct {SectionHeaderRelocs []Relocio.ReaderAt// contains filtered or unexported fields}typeSectionHeader¶
type SectionHeader struct {NamestringVirtualAddressuint64Sizeuint64Typeuint32Relptruint64Nrelocuint32}SectionHeader holds information about an XCOFF section header.
typeSectionHeader32¶
type SectionHeader32 struct {Sname [8]byte// Section nameSpaddruint32// Physical addressSvaddruint32// Virtual addressSsizeuint32// Section sizeSscnptruint32// Offset in file to raw data for sectionSrelptruint32// Offset in file to relocation entries for sectionSlnnoptruint32// Offset in file to line number entries for sectionSnrelocuint16// Number of relocation entriesSnlnnouint16// Number of line number entriesSflagsuint32// Flags to define the section type}Section Header.
typeSectionHeader64¶
type SectionHeader64 struct {Sname [8]byte// Section nameSpaddruint64// Physical addressSvaddruint64// Virtual addressSsizeuint64// Section sizeSscnptruint64// Offset in file to raw data for sectionSrelptruint64// Offset in file to relocation entries for sectionSlnnoptruint64// Offset in file to line number entries for sectionSnrelocuint32// Number of relocation entriesSnlnnouint32// Number of line number entriesSflagsuint32// Flags to define the section typeSpaduint32// Needs to be 72 bytes long}typeSymEnt32¶
type SymEnt32 struct {Nname [8]byte// Symbol nameNvalueuint32// Symbol valueNscnumuint16// Section number of symbolNtypeuint16// Basic and derived type specificationNsclassuint8// Storage class of symbolNnumauxuint8// Number of auxiliary entries}Symbol Table Entry.
typeSymbol¶
type Symbol struct {NamestringValueuint64SectionNumberintStorageClassintAuxFcnAuxiliaryFcnAuxCSectAuxiliaryCSect}