Source File
	xcoff.go
Belonging Package
	internal/xcoff
// Copyright 2018 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package xcoff// File Header.type FileHeader32 struct {Fmagic uint16 // Target machineFnscns uint16 // Number of sectionsFtimedat uint32 // Time and date of file creationFsymptr uint32 // Byte offset to symbol table startFnsyms uint32 // Number of entries in symbol tableFopthdr uint16 // Number of bytes in optional headerFflags uint16 // Flags}type FileHeader64 struct {Fmagic uint16 // Target machineFnscns uint16 // Number of sectionsFtimedat uint32 // Time and date of file creationFsymptr uint64 // Byte offset to symbol table startFopthdr uint16 // Number of bytes in optional headerFflags uint16 // FlagsFnsyms uint32 // Number of entries in symbol table}const (FILHSZ_32 = 20FILHSZ_64 = 24)const (U802TOCMAGIC = 0737 // AIX 32-bit XCOFFU64_TOCMAGIC = 0767 // AIX 64-bit XCOFF)// Flags that describe the type of the object file.const (F_RELFLG = 0x0001F_EXEC = 0x0002F_LNNO = 0x0004F_FDPR_PROF = 0x0010F_FDPR_OPTI = 0x0020F_DSA = 0x0040F_VARPG = 0x0100F_DYNLOAD = 0x1000F_SHROBJ = 0x2000F_LOADONLY = 0x4000)// Section Header.type SectionHeader32 struct {Sname [8]byte // Section nameSpaddr uint32 // Physical addressSvaddr uint32 // Virtual addressSsize uint32 // Section sizeSscnptr uint32 // Offset in file to raw data for sectionSrelptr uint32 // Offset in file to relocation entries for sectionSlnnoptr uint32 // Offset in file to line number entries for sectionSnreloc uint16 // Number of relocation entriesSnlnno uint16 // Number of line number entriesSflags uint32 // Flags to define the section type}type SectionHeader64 struct {Sname [8]byte // Section nameSpaddr uint64 // Physical addressSvaddr uint64 // Virtual addressSsize uint64 // Section sizeSscnptr uint64 // Offset in file to raw data for sectionSrelptr uint64 // Offset in file to relocation entries for sectionSlnnoptr uint64 // Offset in file to line number entries for sectionSnreloc uint32 // Number of relocation entriesSnlnno uint32 // Number of line number entriesSflags uint32 // Flags to define the section typeSpad uint32 // Needs to be 72 bytes long}// Flags defining the section type.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)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)// Symbol Table Entry.type SymEnt32 struct {Nname [8]byte // Symbol nameNvalue uint32 // Symbol valueNscnum uint16 // Section number of symbolNtype uint16 // Basic and derived type specificationNsclass uint8 // Storage class of symbolNnumaux uint8 // Number of auxiliary entries}type SymEnt64 struct {Nvalue uint64 // Symbol valueNoffset uint32 // Offset of the name in string table or .debug sectionNscnum uint16 // Section number of symbolNtype uint16 // Basic and derived type specificationNsclass uint8 // Storage class of symbolNnumaux uint8 // Number of auxiliary entries}const SYMESZ = 18const (// 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)// Storage Class.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)// File Auxiliary Entrytype AuxFile64 struct {Xfname [8]byte // Name or offset inside string tableXftype uint8 // Source file string typeXauxtype uint8 // Type of auxiliary entry}// Function Auxiliary Entrytype AuxFcn32 struct {Xexptr uint32 // File offset to exception table entryXfsize uint32 // Size of function in bytesXlnnoptr uint32 // File pointer to line numberXendndx uint32 // Symbol table index of next entryXpad uint16 // Unused}type AuxFcn64 struct {Xlnnoptr uint64 // File pointer to line numberXfsize uint32 // Size of function in bytesXendndx uint32 // Symbol table index of next entryXpad uint8 // UnusedXauxtype uint8 // Type of auxiliary entry}type AuxSect64 struct {Xscnlen uint64 // section lengthXnreloc uint64 // Num RLDspad uint8Xauxtype uint8 // Type of auxiliary entry}// csect Auxiliary Entry.type AuxCSect32 struct {Xscnlen uint32 // Length or symbol table indexXparmhash uint32 // Offset of parameter type-check stringXsnhash uint16 // .typchk section numberXsmtyp uint8 // Symbol alignment and typeXsmclas uint8 // Storage-mapping classXstab uint32 // ReservedXsnstab uint16 // Reserved}type AuxCSect64 struct {Xscnlenlo uint32 // Lower 4 bytes of length or symbol table indexXparmhash uint32 // Offset of parameter type-check stringXsnhash uint16 // .typchk section numberXsmtyp uint8 // Symbol alignment and typeXsmclas uint8 // Storage-mapping classXscnlenhi uint32 // Upper 4 bytes of length or symbol table indexXpad uint8 // UnusedXauxtype uint8 // Type of auxiliary entry}// Auxiliary typeconst (_AUX_EXCEPT = 255_AUX_FCN = 254_AUX_SYM = 253_AUX_FILE = 252_AUX_CSECT = 251_AUX_SECT = 250)// Symbol type field.const (XTY_ER = 0 // External referenceXTY_SD = 1 // Section definitionXTY_LD = 2 // Label definitionXTY_CM = 3 // Common csect definition)// Defines for File auxiliary definitions: x_ftype field of x_fileconst (XFT_FN = 0 // Source File NameXFT_CT = 1 // Compile Time StampXFT_CV = 2 // Compiler Version NumberXFT_CD = 128 // Compiler Defined Information)// Storage-mapping class.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)// Loader Header.type LoaderHeader32 struct {Lversion uint32 // Loader section version numberLnsyms uint32 // Number of symbol table entriesLnreloc uint32 // Number of relocation table entriesListlen uint32 // Length of import file ID string tableLnimpid uint32 // Number of import file IDsLimpoff uint32 // Offset to start of import file IDsLstlen uint32 // Length of string tableLstoff uint32 // Offset to start of string table}type LoaderHeader64 struct {Lversion uint32 // Loader section version numberLnsyms uint32 // Number of symbol table entriesLnreloc uint32 // Number of relocation table entriesListlen uint32 // Length of import file ID string tableLnimpid uint32 // Number of import file IDsLstlen uint32 // Length of string tableLimpoff uint64 // Offset to start of import file IDsLstoff uint64 // Offset to start of string tableLsymoff uint64 // Offset to start of symbol tableLrldoff uint64 // Offset to start of relocation entries}const (LDHDRSZ_32 = 32LDHDRSZ_64 = 56)// Loader Symbol.type LoaderSymbol32 struct {Lname [8]byte // Symbol name or byte offset into string tableLvalue uint32 // Address fieldLscnum uint16 // Section number containing symbolLsmtype uint8 // Symbol type, export, import flagsLsmclas uint8 // Symbol storage classLifile uint32 // Import file ID; ordinal of import file IDsLparm uint32 // Parameter type-check field}type LoaderSymbol64 struct {Lvalue uint64 // Address fieldLoffset uint32 // Byte offset into string table of symbol nameLscnum uint16 // Section number containing symbolLsmtype uint8 // Symbol type, export, import flagsLsmclas uint8 // Symbol storage classLifile uint32 // Import file ID; ordinal of import file IDsLparm uint32 // Parameter type-check field}type Reloc32 struct {Rvaddr uint32 // (virtual) address of referenceRsymndx uint32 // Index into symbol tableRsize uint8 // Sign and reloc bit lenRtype uint8 // Toc relocation type}type Reloc64 struct {Rvaddr uint64 // (virtual) address of referenceRsymndx uint32 // Index into symbol tableRsize uint8 // Sign and reloc bit lenRtype uint8 // Toc relocation type}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)
|  | The pages are generated with Golds v0.7.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |