Movatterモバイル変換


[0]ホーム

URL:


xcoff

packagestandard library
go1.25.5Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License:BSD-3-ClauseImports:9Imported by:0

Details

Repository

cs.opensource.google/go/go

Links

Documentation

Overview

Package xcoff implements access to XCOFF (Extended Common Object File Format) files.

Index

Constants

View Source
const (SAIAMAG   = 0x8AIAFMAG   = "`\n"AIAMAG    = "<aiaff>\n"AIAMAGBIG = "<bigaf>\n"// SizeofFL_HSZ_BIG = 0x80AR_HSZ_BIG = 0x70)
View Source
const (FILHSZ_32 = 20FILHSZ_64 = 24)
View Source
const (U802TOCMAGIC = 0737// AIX 32-bit XCOFFU64_TOCMAGIC = 0767// AIX 64-bit XCOFF)
View Source
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.

View Source
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.

View Source
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)
View Source
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)
View Source
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.

View Source
const (XTY_ER = 0// External referenceXTY_SD = 1// Section definitionXTY_LD = 2// Label definitionXTY_CM = 3// Common csect definition)

Symbol type field.

View Source
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

View Source
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.

View Source
const (LDHDRSZ_32 = 32LDHDRSZ_64 = 56)
View Source
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)
View Source
const SYMESZ = 18

Variables

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

func NewArchive(rio.ReaderAt) (*Archive,error)

NewArchive creates a new Archive for accessing an AIX big archive in an underlying reader.

funcOpenArchive

func OpenArchive(namestring) (*Archive,error)

OpenArchive opens the named archive using os.Open and prepares it for useas an AIX big archive.

func (*Archive)Close

func (a *Archive) Close()error

Close closes the Archive.If the Archive was created using NewArchive directly instead of OpenArchive,Close has no effect.

func (*Archive)GetFile

func (arch *Archive) GetFile(namestring) (*File,error)

GetFile returns the XCOFF file defined by member name.FIXME: This doesn't work if an archive has two members with the samename which can occur if an archive has both 32-bits and 64-bits files.

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

typeAuxFcn64

type AuxFcn64 struct {Xlnnoptruint64// File pointer to line numberXfsizeuint32// Size of function in bytesXendndxuint32// Symbol table index of next entryXpaduint8// UnusedXauxtypeuint8// Type of 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

typeAuxSect64

type AuxSect64 struct {Xscnlenuint64// section lengthXnrelocuint64// Num RLDsXauxtypeuint8// Type of auxiliary entry// contains filtered or unexported fields}

typeAuxiliaryCSect

type AuxiliaryCSect struct {Lengthint64StorageMappingClassintSymbolTypeint}

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.

funcNewFile

func NewFile(rio.ReaderAt) (*File,error)

NewFile creates a new File for accessing an XCOFF binary in an underlying reader.

funcOpen

func Open(namestring) (*File,error)

Open opens the named file using os.Open and prepares it for use as an XCOFF binary.

func (*File)CSect

func (f *File) CSect(namestring) []byte

CSect reads and returns the contents of a csect.

func (*File)Close

func (f *File) Close()error

Close closes the File.If the File was created using NewFile directly instead of Open,Close has no effect.

func (*File)DWARF

func (f *File) DWARF() (*dwarf.Data,error)

func (*File)ImportedLibraries

func (f *File) ImportedLibraries() ([]string,error)

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

func (f *File) Section(namestring) *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

func (f *File) SectionByType(typuint32) *Section

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

type ImportedSymbol struct {NamestringLibrarystring}

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

type MemberHeader struct {NamestringSizeuint64}

MemberHeader holds information about a big archive member

typeReloc

type Reloc struct {VirtualAddressuint64Symbol           *SymbolSignedboolInstructionFixedboolLengthuint8Typeuint8}

typeReloc32

type Reloc32 struct {Rvaddruint32// (virtual) address of referenceRsymndxuint32// Index into symbol tableRsizeuint8// Sign and reloc bit lenRtypeuint8// Toc relocation type}

typeReloc64

type Reloc64 struct {Rvaddruint64// (virtual) address of referenceRsymndxuint32// Index into symbol tableRsizeuint8// Sign and reloc bit lenRtypeuint8// Toc relocation type}

typeSection

type Section struct {SectionHeaderRelocs []Relocio.ReaderAt// contains filtered or unexported fields}

func (*Section)Data

func (s *Section) Data() ([]byte,error)

Data reads and returns the contents of the XCOFF section s.

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.

typeSymEnt64

type SymEnt64 struct {Nvalueuint64// Symbol valueNoffsetuint32// Offset of the name in string table or .debug sectionNscnumuint16// Section number of symbolNtypeuint16// Basic and derived type specificationNsclassuint8// Storage class of symbolNnumauxuint8// Number of auxiliary entries}

typeSymbol

type Symbol struct {NamestringValueuint64SectionNumberintStorageClassintAuxFcnAuxiliaryFcnAuxCSectAuxiliaryCSect}

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp