目录 搜索
archive archive/tar archive/zip bufio bufio(缓存) builtin builtin(内置包) bytes bytes(包字节) compress compress/bzip2(压缩/bzip2) compress/flate(压缩/flate) compress/gzip(压缩/gzip) compress/lzw(压缩/lzw) compress/zlib(压缩/zlib) container container/heap(容器数据结构heap) container/list(容器数据结构list) container/ring(容器数据结构ring) context context(上下文) crypto crypto(加密) crypto/aes(加密/aes) crypto/cipher(加密/cipher) crypto/des(加密/des) crypto/dsa(加密/dsa) crypto/ecdsa(加密/ecdsa) crypto/elliptic(加密/elliptic) crypto/hmac(加密/hmac) crypto/md5(加密/md5) crypto/rand(加密/rand) crypto/rc4(加密/rc4) crypto/rsa(加密/rsa) crypto/sha1(加密/sha1) crypto/sha256(加密/sha256) crypto/sha512(加密/sha512) crypto/subtle(加密/subtle) crypto/tls(加密/tls) crypto/x509(加密/x509) crypto/x509/pkix(加密/x509/pkix) database database/sql(数据库/sql) database/sql/driver(数据库/sql/driver) debug debug/dwarf(调试/dwarf) debug/elf(调试/elf) debug/gosym(调试/gosym) debug/macho(调试/macho) debug/pe(调试/pe) debug/plan9obj(调试/plan9obj) encoding encoding(编码) encoding/ascii85(编码/ascii85) encoding/asn1(编码/asn1) encoding/base32(编码/base32) encoding/base64(编码/base64) encoding/binary(编码/binary) encoding/csv(编码/csv) encoding/gob(编码/gob) encoding/hex(编码/hex) encoding/json(编码/json) encoding/pem(编码/pem) encoding/xml(编码/xml) errors errors(错误) expvar expvar flag flag(命令行参数解析flag包) fmt fmt go go/ast(抽象语法树) go/build go/constant(常量) go/doc(文档) go/format(格式) go/importer go/parser go/printer go/scanner(扫描仪) go/token(令牌) go/types(类型) hash hash(散列) hash/adler32 hash/crc32 hash/crc64 hash/fnv html html html/template(模板) image image(图像) image/color(颜色) image/color/palette(调色板) image/draw(绘图) image/gif image/jpeg image/png index index/suffixarray io io io/ioutil log log log/syslog(日志系统) math math math/big math/big math/bits math/bits math/cmplx math/cmplx math/rand math/rand mime mime mime/multipart(多部分) mime/quotedprintable net net net/http net/http net/http/cgi net/http/cookiejar net/http/fcgi net/http/httptest net/http/httptrace net/http/httputil net/http/internal net/http/pprof net/mail net/mail net/rpc net/rpc net/rpc/jsonrpc net/smtp net/smtp net/textproto net/textproto net/url net/url os os os/exec os/signal os/user path path path/filepath(文件路径) plugin plugin(插件) reflect reflect(反射) regexp regexp(正则表达式) regexp/syntax runtime runtime(运行时) runtime/debug(调试) runtime/internal/sys runtime/pprof runtime/race(竞争) runtime/trace(执行追踪器) sort sort(排序算法) strconv strconv(转换) strings strings(字符串) sync sync(同步) sync/atomic(原子操作) syscall syscall(系统调用) testing testing(测试) testing/iotest testing/quick text text/scanner(扫描文本) text/tabwriter text/template(定义模板) text/template/parse time time(时间戳) unicode unicode unicode/utf16 unicode/utf8 unsafe unsafe
文字

  • import "debug/elf"

  • 概述

  • 参数

概述

封装 ELF 实现了对 ELF 对象文件的访问。

索引

  • Constants

  • Variables

  • func R_INFO(sym, typ uint32) uint64

  • func R_INFO32(sym, typ uint32) uint32

  • func R_SYM32(info uint32) uint32

  • func R_SYM64(info uint64) uint32

  • func R_TYPE32(info uint32) uint32

  • func R_TYPE64(info uint64) uint32

  • func ST_INFO(bind SymBind, typ SymType) uint8

  • type Chdr32

  • type Chdr64

  • type Class

  • func (i Class) GoString() string

  • func (i Class) String() string

  • type CompressionType

  • func (i CompressionType) GoString() string

  • func (i CompressionType) String() string

  • type Data

  • func (i Data) GoString() string

  • func (i Data) String() string

  • type Dyn32

  • type Dyn64

  • type DynFlag

  • func (i DynFlag) GoString() string

  • func (i DynFlag) String() string

  • type DynTag

  • func (i DynTag) GoString() string

  • func (i DynTag) String() string

  • type File

  • func NewFile(r io.ReaderAt) (*File, error)

  • func Open(name string) (*File, error)

  • func (f *File) Close() error

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

  • func (f *File) DynString(tag DynTag) ([]string, error)

  • func (f *File) DynamicSymbols() ([]Symbol, 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 SectionType) *Section

  • func (f *File) Symbols() ([]Symbol, error)

  • type FileHeader

  • type FormatError

  • func (e *FormatError) Error() string

  • type Header32

  • type Header64

  • type ImportedSymbol

  • type Machine

  • func (i Machine) GoString() string

  • func (i Machine) String() string

  • type NType

  • func (i NType) GoString() string

  • func (i NType) String() string

  • type OSABI

  • func (i OSABI) GoString() string

  • func (i OSABI) String() string

  • type Prog

  • func (p *Prog) Open() io.ReadSeeker

  • type Prog32

  • type Prog64

  • type ProgFlag

  • func (i ProgFlag) GoString() string

  • func (i ProgFlag) String() string

  • type ProgHeader

  • type ProgType

  • func (i ProgType) GoString() string

  • func (i ProgType) String() string

  • type R_386

  • func (i R_386) GoString() string

  • func (i R_386) String() string

  • type R_390

  • func (i R_390) GoString() string

  • func (i R_390) String() string

  • type R_AARCH64

  • func (i R_AARCH64) GoString() string

  • func (i R_AARCH64) String() string

  • type R_ALPHA

  • func (i R_ALPHA) GoString() string

  • func (i R_ALPHA) String() string

  • type R_ARM

  • func (i R_ARM) GoString() string

  • func (i R_ARM) String() string

  • type R_MIPS

  • func (i R_MIPS) GoString() string

  • func (i R_MIPS) String() string

  • type R_PPC

  • func (i R_PPC) GoString() string

  • func (i R_PPC) String() string

  • type R_PPC64

  • func (i R_PPC64) GoString() string

  • func (i R_PPC64) String() string

  • type R_SPARC

  • func (i R_SPARC) GoString() string

  • func (i R_SPARC) String() string

  • type R_X86_64

  • func (i R_X86_64) GoString() string

  • func (i R_X86_64) String() string

  • type Rel32

  • type Rel64

  • type Rela32

  • type Rela64

  • type Section

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

  • func (s *Section) Open() io.ReadSeeker

  • type Section32

  • type Section64

  • type SectionFlag

  • func (i SectionFlag) GoString() string

  • func (i SectionFlag) String() string

  • type SectionHeader

  • type SectionIndex

  • func (i SectionIndex) GoString() string

  • func (i SectionIndex) String() string

  • type SectionType

  • func (i SectionType) GoString() string

  • func (i SectionType) String() string

  • type Sym32

  • type Sym64

  • type SymBind

  • func ST_BIND(info uint8) SymBind

  • func (i SymBind) GoString() string

  • func (i SymBind) String() string

  • type SymType

  • func ST_TYPE(info uint8) SymType

  • func (i SymType) GoString() string

  • func (i SymType) String() string

  • type SymVis

  • func ST_VISIBILITY(other uint8) SymVis

  • func (i SymVis) GoString() string

  • func (i SymVis) String() string

  • type Symbol

  • type Type

  • func (i Type) GoString() string

  • func (i Type) String() string

  • type Version

  • func (i Version) GoString() string

  • func (i Version) String() string

打包文件

elf.go file.go reader.go

常量

索引到Header.Ident数组中。

const (
        EI_CLASS      = 4  /* 机器类别。 */
        EI_DATA       = 5  /* 数据格式。 */
        EI_VERSION    = 6  /* ELF格式版本。 */
        EI_OSABI      = 7  /* 操作系统/ABI识别 */
        EI_ABIVERSION = 8  /* ABI版 */
        EI_PAD        = 9  /* 填充开始(根据SVR4 ABI)。 */
        EI_NIDENT     = 16 /* e_ident数组的大小。 */)

ELF的神奇数字,明智地被选为即时的值。

const ARM_MAGIC_TRAMP_NUMBER = 0x5c000003

ELF文件的初始数值。

const ELFMAG = "\177ELF"
const Sym32Size = 16
const Sym64Size = 24

变量

如果文件中没有这样的部分,则 ErrNoSymbols 由 File.Symbols 和 File.DynamicSymbols 返回。

var ErrNoSymbols = errors.New("no symbol section")

func R_INFO

func R_INFO(sym, typ uint32) uint64

func R_INFO32

func R_INFO32(sym, typ uint32) uint32

func R_SYM32

func R_SYM32(info uint32) uint32

func R_SYM64

func R_SYM64(info uint64) uint32

func R_TYPE32

func R_TYPE32(info uint32) uint32

func R_TYPE64

func R_TYPE64(info uint64) uint32

func ST_INFO

func ST_INFO(bind SymBind, typ SymType) uint8

type Chdr32

ELF32 压缩标题。

type Chdr32 struct {
        Type      uint32
        Size      uint32
        Addralign uint32}

type Chdr64

ELF64 压缩标题。

type Chdr64 struct {
        Type uint32

        Size      uint64
        Addralign uint64        // 包含过滤或未导出的字段}

type Class

Class 在 Header.IdentEI_CLASS 和 Header.Class 中找到。

type Class byte
const (
        ELFCLASSNONE Class = 0 /* 未知的类别。 */
        ELFCLASS32   Class = 1 /* 32位架构。 */
        ELFCLASS64   Class = 2 /* 64位架构。 */)

func (Class) GoString

func (i Class) GoString() string

func (Class) String

func (i Class) String() string

type CompressionType

部分压缩类型。

type CompressionType int
const (
        COMPRESS_ZLIB   CompressionType = 1          /* ZLIB压缩。 */
        COMPRESS_LOOS   CompressionType = 0x60000000 /* 第一个特定于操作系统 */
        COMPRESS_HIOS   CompressionType = 0x6fffffff /* 最后一个特定于OS的。 */
        COMPRESS_LOPROC CompressionType = 0x70000000 /* 第一种处理器特定类型。 */
        COMPRESS_HIPROC CompressionType = 0x7fffffff /* 最后一个处理器特定类型。 */)

func (CompressionType) GoString

func (i CompressionType) GoString() string

func (CompressionType) String

func (i CompressionType) String() string

type Data

数据位于 Header.IdentEI_DATA 和 Header.Data 中。

type Data byte
const (
        ELFDATANONE Data = 0 /* 未知的数据格式。 */
        ELFDATA2LSB Data = 1 /* 2的补充little-endian。 */
        ELFDATA2MSB Data = 2 /* 2的补充big-endian。 */)

func (Data) GoString

func (i Data) GoString() string

func (Data) String

func (i Data) String() string

type Dyn32

ELF32 动态结构。“.dynamic” 部分包含它们的数组。

type Dyn32 struct {
        Tag int32  /* 输入类型。 */
        Val uint32 /* 整数/地址值。 */}

type Dyn64

ELF64 动态结构。“.dynamic” 部分包含它们的数组。

type Dyn64 struct {
        Tag int64  /* 输入类型。 */
        Val uint64 /* 整数/地址值 */}

type DynFlag

DT_FLAGS 值。

type DynFlag int
const (
        DF_ORIGIN DynFlag = 0x0001 /* 表示正在加载的对象可能
           参考
           $ORIGIN 替换字符串 */
        DF_SYMBOLIC DynFlag = 0x0002 /* 表示“symbolic”链接。 */
        DF_TEXTREL  DynFlag = 0x0004 /* 表示可写区段中可能存在重定位。 */
        DF_BIND_NOW DynFlag = 0x0008 /* 表示动态链接器应该
           处理对象的所有重定位
           转移前包含此条目
           控制程序。 */
        DF_STATIC_TLS DynFlag = 0x0010 /* 表示共享对象或
           可执行文件包含使用静态代码
           线程本地存储方案。 */)

func (DynFlag) GoString

func (i DynFlag) GoString() string

func (DynFlag) String

func (i DynFlag) String() string

type DynTag

Dyn.Tag

type DynTag int
const (
        DT_NULL         DynTag = 0  /* 终止输入。 */
        DT_NEEDED       DynTag = 1  /* 所需共享库的字符串表偏移量。 */
        DT_PLTRELSZ     DynTag = 2  /* PLT重定位的总大小(以字节为单位)。 */
        DT_PLTGOT       DynTag = 3  /* 依赖于处理器的地址。 */
        DT_HASH         DynTag = 4  /* 符号哈希表的地址。 */
        DT_STRTAB       DynTag = 5  /* 字符串表的地址。 */
        DT_SYMTAB       DynTag = 6  /* 符号表的地址。 */
        DT_RELA         DynTag = 7  /* ElfNN_Rela搬迁地址。 */
        DT_RELASZ       DynTag = 8  /* ElfNN_Rela重定位的总大小。 */
        DT_RELAENT      DynTag = 9  /* 每个ElfNN_Rela重定位条目的大小。 */
        DT_STRSZ        DynTag = 10 /* 字符串表的大小。 */
        DT_SYMENT       DynTag = 11 /* 每个符号表条目的大小。 */
        DT_INIT         DynTag = 12 /* 初始化函数的地址。 */
        DT_FINI         DynTag = 13 /* 终结函数的地址。 */
        DT_SONAME       DynTag = 14 /* 共享对象名称的字符串表偏移量。 */
        DT_RPATH        DynTag = 15 /* path. [sup]库的字符串表偏移量  */
        DT_SYMBOLIC     DynTag = 16 /* 表示“symbolic” linking.[sup] */
        DT_REL          DynTag = 17 /* ElfNN_Rel重新安置的地址。 */
        DT_RELSZ        DynTag = 18 /* ElfNN_Rel重定位的总大小。 */
        DT_RELENT       DynTag = 19 /* 每个ElfNN_Rel重定位的大小。 */
        DT_PLTREL       DynTag = 20 /* PLT使用的搬迁类型。 */
        DT_DEBUG        DynTag = 21 /* 保留(未使用)。 */
        DT_TEXTREL      DynTag = 22 /* 表示可写区段中可能存在重定位。[SUP] */
        DT_JMPREL       DynTag = 23 /* PLT重新安置的地址。 */
        DT_BIND_NOW     DynTag = 24 /* [sup] */
        DT_INIT_ARRAY   DynTag = 25 /* 初始化函数指针数组的地址 */
        DT_FINI_ARRAY   DynTag = 26 /* 指向终止函数的指针数组的地址 */
        DT_INIT_ARRAYSZ DynTag = 27 /* 初始化函数数组的大小(以字节为单位)。 */
        DT_FINI_ARRAYSZ DynTag = 28 /* 终止函数数组的大小(以字节为单位)。 */
        DT_RUNPATH      DynTag = 29 /* 以null结尾的库搜索路径字符串的字符串表偏移量。 */
        DT_FLAGS        DynTag = 30 /* 对象特定的标志值。 */
        DT_ENCODING     DynTag = 32 /* 值大于或等于DT_ENCODING
           并且小于DT_LOOS遵循规则
           对d_un联盟的解释
           如下:even =='d_ptr',even =='d_val'
           或者没有 */
        DT_PREINIT_ARRAY   DynTag = 32         /* 指向预初始化函数的指针数组的地址。 */
        DT_PREINIT_ARRAYSZ DynTag = 33         /* 预初始化函数数组的大小(以字节为单位)。 */
        DT_LOOS            DynTag = 0x6000000d /* 第一个特定于操作系统 */
        DT_HIOS            DynTag = 0x6ffff000 /* 最后一个特定于OS的 */
        DT_VERSYM          DynTag = 0x6ffffff0
        DT_VERNEED         DynTag = 0x6ffffffe
        DT_VERNEEDNUM      DynTag = 0x6fffffff
        DT_LOPROC          DynTag = 0x70000000 /* 第一种处理器特定类型。 */
        DT_HIPROC          DynTag = 0x7fffffff /* 最后一个处理器特定类型。 */)

func (DynTag) GoString

func (i DynTag) GoString() string

func (DynTag) String

func (i DynTag) String() string

type File

文件表示一个开放的 ELF 文件。

type File struct {
        FileHeader
        Sections []*Section
        Progs    []*Prog        // 包含过滤或未导出的字段}

func NewFile

func NewFile(r io.ReaderAt) (*File, error)

NewFile 创建一个新的文件来访问底层阅读器中的 ELF 二进制文件。ELF 二进制文件预计从 ReaderAt 的位置0开始。

func Open

func Open(name string) (*File, error)

打开使用 os.Open 打开命名文件,并准备将其用作 ELF 二进制文件。

func (*File) Close

func (f *File) Close() error

关闭文件。如果文件是直接使用 NewFile 而不是 Open 来创建的,则 Close 不起作用。

func (*File) DWARF

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

func (*File) DynString

func (f *File) DynString(tag DynTag) ([]string, error)

DynString 返回在文件的动态部分中为给定标签列出的字符串。

标签必须是一个接受字符串值的标签:DT_NEEDED,DT_SONAME,DT_RPATH或DT_RUNPATH。

func (*File) DynamicSymbols

func (f *File) DynamicSymbols() ([]Symbol, error)

DynamicSymbols 返回 f 的动态符号表。符号将按照它们在 f 中出现的顺序列出。

为了与符号兼容,DynamicSymbols 省略了索引 0 处的空符号。在将符号作为 symtab 检索后,外部提供的索引 x 对应于 symtabx-1,而不是 symtabx。

func (*File) ImportedLibraries

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

ImportedLibraries 返回二进制文件f引用的所有库的名称,这些库在动态链接时期预计将与二进制文件链接。

func (*File) ImportedSymbols

func (f *File) ImportedSymbols() ([]ImportedSymbol, error)

ImportedSymbols 返回二进制文件 f 引用的所有符号的名称,动态加载时期望其他库会满足这些名称。它不会返回弱符号。

func (*File) Section

func (f *File) Section(name string) *Section

部分返回给定名称的部分,如果不存在此部分,则返回 nil。

func (*File) SectionByType

func (f *File) SectionByType(typ SectionType) *Section

SectionByType 返回 f 中给定类型的第一个部分,如果没有这个部分,则返回 nil。

func (*File) Symbols

func (f *File) Symbols() ([]Symbol, error)

符号返回 f 的符号表。符号将按照它们在 f 中出现的顺序列出。

为了与 Go 1.0 兼容,Symbols 在索引0处省略了空符号。在将符号作为 symtab 检索后,外部提供的索引 x 对应于 symtabx-1,而不是 symtabx。

type FileHeader

FileHeader 表示 ELF 文件头。

type FileHeader struct {
        Class      Class
        Data       Data
        Version    Version
        OSABI      OSABI
        ABIVersion uint8
        ByteOrder  binary.ByteOrder
        Type       Type
        Machine    Machine
        Entry      uint64}

type FormatError

type FormatError struct {        // 包含过滤或未导出的字段}

func (*FormatError) Error

func (e *FormatError) Error() string

type Header32

ELF32 文件头。

type Header32 struct {
        Ident     [EI_NIDENT]byte /* 文件识别。 */
        Type      uint16          /* 文件类型。 */
        Machine   uint16          /* 机器架构。 */
        Version   uint32          /* ELF格式版本。 */
        Entry     uint32          /* 入口点。 */
        Phoff     uint32          /* 程序头文件偏移量。 */
        Shoff     uint32          /* 节头文件偏移量。 */
        Flags     uint32          /* 特定于架构的标志。 */
        Ehsize    uint16          /* ELF标题的大小(以字节为单位)。 */
        Phentsize uint16          /* 程序头条目的大小。 */
        Phnum     uint16          /* 程序头条目数。 */
        Shentsize uint16          /* 节标题条目的大小。 */
        Shnum     uint16          /* 节头条目的数量。 */
        Shstrndx  uint16          /* 节名称字符串部分。 */}

type Header64

ELF64 文件头。

type Header64 struct {
        Ident     [EI_NIDENT]byte /* 文件识别。 */
        Type      uint16          /* 文件类型。 */
        Machine   uint16          /* 机器架构。 */
        Version   uint32          /* ELF格式版本。 */
        Entry     uint64          /* 入口点。*/
        Phoff     uint64          /* 程序头文件偏移量。 */
        Shoff     uint64          /* 节头文件偏移量。 */
        Flags     uint32          /* 特定于架构的标志。 */
        Ehsize    uint16          /* ELF头的大小(以字节为单位)。 */
        Phentsize uint16          /* 程序头条目的大小。*/
        Phnum     uint16          /* 程序头条目数。 */
        Shentsize uint16          /* 节标题条目的大小。 */
        Shnum     uint16          /* 节头条目的数量。 */
        Shstrndx  uint16          /* 节名称字符串部分。 */}

type ImportedSymbol

type ImportedSymbol struct {
        Name    string
        Version string
        Library string}

type Machine

Machine 在 Header.Machine 中找到。

type Machine uint16
const (
        EM_NONE        Machine = 0   /* 未知机器*。/
        EM_M32         Machine = 1   /* AT&T WE32100。 */
        EM_SPARC       Machine = 2   /* Sun SPARC。 */
        EM_386         Machine = 3   /* Intel i386。 */
        EM_68K         Machine = 4   /* Motorola 68000。 */
        EM_88K         Machine = 5   /* Motorola 88000。 */
        EM_860         Machine = 7   /* Intel i860。 */
        EM_MIPS        Machine = 8   /* 仅限MIPS R3000 Big-Endian。 */
        EM_S370        Machine = 9   /* IBM System/370。 */
        EM_MIPS_RS3_LE Machine = 10  /* MIPS R3000 Little-Endian。 */
        EM_PARISC      Machine = 15  /* HP PA-RISC。 */
        EM_VPP500      Machine = 17  /* Fujitsu VPP500。 */
        EM_SPARC32PLUS Machine = 18  /* SPARC v8plus。 */
        EM_960         Machine = 19  /* Intel 80960。 */
        EM_PPC         Machine = 20  /* PowerPC 32-bit。 */
        EM_PPC64       Machine = 21  /* PowerPC 64-bit。 */
        EM_S390        Machine = 22  /* IBM System/390。 */
        EM_V800        Machine = 36  /* NEC V800。 */
        EM_FR20        Machine = 37  /* Fujitsu FR20。 */
        EM_RH32        Machine = 38  /* TRW RH-32。 */
        EM_RCE         Machine = 39  /* Motorola RCE。 */
        EM_ARM         Machine = 40  /* ARM。 */
        EM_SH          Machine = 42  /* Hitachi SH。 */
        EM_SPARCV9     Machine = 43  /* SPARC v9 64-bit。 */
        EM_TRICORE     Machine = 44  /* 西门子TriCore嵌入式处理器。 */
        EM_ARC         Machine = 45  /* Argonaut RISC Core。 */
        EM_H8_300      Machine = 46  /* Hitachi H8/300。 */
        EM_H8_300H     Machine = 47  /* Hitachi H8/300H。 */
        EM_H8S         Machine = 48  /* Hitachi H8S。 */
        EM_H8_500      Machine = 49  /* Hitachi H8/500。 */
        EM_IA_64       Machine = 50  /* Intel IA-64 Processor。 */
        EM_MIPS_X      Machine = 51  /* Stanford MIPS-X。 */
        EM_COLDFIRE    Machine = 52  /* Motorola ColdFire。 */
        EM_68HC12      Machine = 53  /* Motorola M68HC12。 */
        EM_MMA         Machine = 54  /* Fujitsu MMA。 */
        EM_PCP         Machine = 55  /* Siemens PCP。 */
        EM_NCPU        Machine = 56  /* Sony nCPU。 */
        EM_NDR1        Machine = 57  /* Denso NDR1微处理器。 */
        EM_STARCORE    Machine = 58  /* 摩托罗拉Star *Core 处理器。 */
        EM_ME16        Machine = 59  /* 丰田ME16处理器。 */
        EM_ST100       Machine = 60  /* STM半导体ST100处理器。 */
        EM_TINYJ       Machine = 61  /* Advanced Logic Corp. TinyJ处理器。 */
        EM_X86_64      Machine = 62  /* Advanced Micro Devices x86-64 */
        EM_AARCH64     Machine = 183 /* ARM 64-bit Architecture (AArch64) */        /* 非标准或已弃用。 */
        EM_486         Machine = 6      /* Intel i486. */
        EM_MIPS_RS4_BE Machine = 10     /* MIPS R4000 Big-Endian */
        EM_ALPHA_STD   Machine = 41     /* Digital Alpha(标准值)。 */
        EM_ALPHA       Machine = 0x9026 /* Alpha(在没有ABI的情况下编写) */)

func (Machine) GoString

func (i Machine) GoString() string

func (Machine) String

func (i Machine) String() string

type NType

NType 值;用于核心文件。

type NType int
const (
        NT_PRSTATUS NType = 1 /* 流程状态。 */
        NT_FPREGSET NType = 2 /* 浮点寄存器。 */
        NT_PRPSINFO NType = 3 /* 处理状态信息。 */)

func (NType) GoString

func (i NType) GoString() string

func (NType) String

func (i NType) String() string

type OSABI

OSABI 位于 Header.IdentEI_OSABI 和 Header.OSABI中。

type OSABI byte
const (
        ELFOSABI_NONE       OSABI = 0   /* UNIX系统V ABI */
        ELFOSABI_HPUX       OSABI = 1   /* HP-UX操作系统 */
        ELFOSABI_NETBSD     OSABI = 2   /* NetBSD */
        ELFOSABI_LINUX      OSABI = 3   /* GNU/Linux */
        ELFOSABI_HURD       OSABI = 4   /* GNU/Hurd */
        ELFOSABI_86OPEN     OSABI = 5   /* 86Open common IA32 ABI */
        ELFOSABI_SOLARIS    OSABI = 6   /* Solaris */
        ELFOSABI_AIX        OSABI = 7   /* AIX */
        ELFOSABI_IRIX       OSABI = 8   /* IRIX */
        ELFOSABI_FREEBSD    OSABI = 9   /* FreeBSD */
        ELFOSABI_TRU64      OSABI = 10  /* TRU64 UNIX */
        ELFOSABI_MODESTO    OSABI = 11  /* Novell Modesto */
        ELFOSABI_OPENBSD    OSABI = 12  /* OpenBSD */
        ELFOSABI_OPENVMS    OSABI = 13  /* Open VMS */
        ELFOSABI_NSK        OSABI = 14  /* HP Non-Stop Kernel */
        ELFOSABI_ARM        OSABI = 97  /* ARM */
        ELFOSABI_STANDALONE OSABI = 255 /* 独立(嵌入式)应用程序 */)

func (OSABI) GoString

func (i OSABI) GoString() string

func (OSABI) String

func (i OSABI) String() string

type Prog

Prog 表示 ELF 二进制文件中的单个ELF程序头文件。

type Prog struct {
        ProgHeader        // 为ReadAt方法嵌入ReaderAt。        // 不要直接嵌入SectionReader        // 避免阅读和寻求。        // 如果客户想要阅读和寻求它必须使用        // Open() 以避免争夺搜索偏移量        // 与其他客户。
        io.ReaderAt        // 包含过滤或未导出的字段}

func (*Prog) Open

func (p *Prog) Open() io.ReadSeeker

Open 返回读取ELF程序主体的新 ReadSeeker。

type Prog32

ELF32 程序标题。

type Prog32 struct {
        Type   uint32 /* 输入类型。 */
        Off    uint32 /* 内容的文件偏移量。 */
        Vaddr  uint32 /* 内存映像中的虚拟地址。 */
        Paddr  uint32 /* 物理地址(未使用)。 */
        Filesz uint32 /* 文件中的内容大小。 */
        Memsz  uint32 /* 内存中的内容大小。 */
        Flags  uint32 /* 访问权限标志。 */
        Align  uint32 /* 内存和文件中的对齐方式。 */}

type Prog64

ELF64程序标题。

type Prog64 struct {
        Type   uint32 /* 输入类型。 */
        Flags  uint32 /* 访问权限标志。 */
        Off    uint64 /* 内容的文件偏移量。 */
        Vaddr  uint64 /* 内存映像中的虚拟地址。 */
        Paddr  uint64 /* 物理地址(未使用)。 */
        Filesz uint64 /* 文件中的内容大小。 */
        Memsz  uint64 /* 内存中的内容大小。 */
        Align  uint64 /* 内存和文件中的对齐方式。 */}

type ProgFlag

Prog.Flag

type ProgFlag uint32
const (
        PF_X        ProgFlag = 0x1        /* 可执行文件。 */
        PF_W        ProgFlag = 0x2        /* 可写。 */
        PF_R        ProgFlag = 0x4        /* 可读。 */
        PF_MASKOS   ProgFlag = 0x0ff00000 /* 特定于操作系统。 */
        PF_MASKPROC ProgFlag = 0xf0000000 /* 处理器特有的。 */)

func (ProgFlag) GoString

func (i ProgFlag) GoString() string

func (ProgFlag) String

func (i ProgFlag) String() string

type ProgHeader(查看源代码)

ProgHeader 表示一个 ELF 程序标题。

type ProgHeader struct {
        Type   ProgType
        Flags  ProgFlag
        Off    uint64
        Vaddr  uint64
        Paddr  uint64
        Filesz uint64
        Memsz  uint64
        Align  uint64}

type ProgType

Prog.Type

type ProgType int
const (
        PT_NULL    ProgType = 0          /* 未使用的条目。 */
        PT_LOAD    ProgType = 1          /* 可装载部分。 */
        PT_DYNAMIC ProgType = 2          /* 动态链接信息段。 */
        PT_INTERP  ProgType = 3          /* 直译器的路径名。 */
        PT_NOTE    ProgType = 4          /* 辅助信息。 */
        PT_SHLIB   ProgType = 5          /* 保留(未使用)。 */
        PT_PHDR    ProgType = 6          /* 程序标头本身的位置。 */
        PT_TLS     ProgType = 7          /* 线程本地存储段 */
        PT_LOOS    ProgType = 0x60000000 /* 第一个特定于操作系统 */
        PT_HIOS    ProgType = 0x6fffffff /* 最后一个特定于OS的。 */
        PT_LOPROC  ProgType = 0x70000000 /* 第一种处理器特定类型。 */
        PT_HIPROC  ProgType = 0x7fffffff /* 最后一个处理器特定类型。 */)

func (ProgType) GoString

func (i ProgType) GoString() string

func (ProgType) String

func (i ProgType) String() string

type R_386

386重新安置类型。

type R_386 int
const (
        R_386_NONE         R_386 = 0  /* 没有搬迁。 */
        R_386_32           R_386 = 1  /* 添加符号值。 */
        R_386_PC32         R_386 = 2  /* 添加PC相对符号值。 */
        R_386_GOT32        R_386 = 3  /* 添加PC相对GOT偏移量。 */
        R_386_PLT32        R_386 = 4  /* 添加PC相对PLT偏移量。 */
        R_386_COPY         R_386 = 5  /* 从共享对象复制数据。 */
        R_386_GLOB_DAT     R_386 = 6  /* 将GOT条目设置为数据地址。 */
        R_386_JMP_SLOT     R_386 = 7  /* 将GOT条目设置为代码地址。 */
        R_386_RELATIVE     R_386 = 8  /* 添加共享对象的加载地址。 */
        R_386_GOTOFF       R_386 = 9  /* 添加GOT相对符号地址。 */
        R_386_GOTPC        R_386 = 10 /* 添加PC相对GOT表地址。 */
        R_386_TLS_TPOFF    R_386 = 14 /* 静态TLS块中的负偏移量 */
        R_386_TLS_IE       R_386 = 15 /* -ve static TLS的GOT绝对地址 */
        R_386_TLS_GOTIE    R_386 = 16 /* 负静态TLS块的GOT条目 */
        R_386_TLS_LE       R_386 = 17 /* 相对于静态TLS的负偏移 */
        R_386_TLS_GD       R_386 = 18 /* GOT(index,off)对的32位偏移量 */
        R_386_TLS_LDM      R_386 = 19 /* 32位偏移到GOT(index,zero)对 */
        R_386_TLS_GD_32    R_386 = 24 /* GOT(索引,关闭)对的32位偏移量 */
        R_386_TLS_GD_PUSH  R_386 = 25 /* Sun ABI GD序列的pushl指令 */
        R_386_TLS_GD_CALL  R_386 = 26 /* Sun ABI GD序列的调用指令 */
        R_386_TLS_GD_POP   R_386 = 27 /* Sun ABI GD序列的popl指令 */
        R_386_TLS_LDM_32   R_386 = 28 /* 32位偏移到GOT(index,zero)对 */
        R_386_TLS_LDM_PUSH R_386 = 29 /* Sun ABI LD序列的pushl指令 */
        R_386_TLS_LDM_CALL R_386 = 30 /* Sun ABI LD序列的调用指令 */
        R_386_TLS_LDM_POP  R_386 = 31 /* Sun ABI LD序列的popl指令 */
        R_386_TLS_LDO_32   R_386 = 32 /* 从TLS块开始的32位偏移 */
        R_386_TLS_IE_32    R_386 = 33 /* 到GOT静态TLS偏移条目的32位偏移 */
        R_386_TLS_LE_32    R_386 = 34 /* 静态TLS块内的32位偏移量 */
        R_386_TLS_DTPMOD32 R_386 = 35 /* 包含TLS索引的GOT条目 */
        R_386_TLS_DTPOFF32 R_386 = 36 /* 包含TLS偏移的GOT条目 */
        R_386_TLS_TPOFF32  R_386 = 37 /* GOT输入-ve static TLS偏移量 */)

func (R_386) GoString

func (i R_386) GoString() string

func (R_386) String

func (i R_386) String() string

type R_390

s390x 处理器的重新分配类型。

type R_390 int
const (
        R_390_NONE        R_390 = 0
        R_390_8           R_390 = 1
        R_390_12          R_390 = 2
        R_390_16          R_390 = 3
        R_390_32          R_390 = 4
        R_390_PC32        R_390 = 5
        R_390_GOT12       R_390 = 6
        R_390_GOT32       R_390 = 7
        R_390_PLT32       R_390 = 8
        R_390_COPY        R_390 = 9
        R_390_GLOB_DAT    R_390 = 10
        R_390_JMP_SLOT    R_390 = 11
        R_390_RELATIVE    R_390 = 12
        R_390_GOTOFF      R_390 = 13
        R_390_GOTPC       R_390 = 14
        R_390_GOT16       R_390 = 15
        R_390_PC16        R_390 = 16
        R_390_PC16DBL     R_390 = 17
        R_390_PLT16DBL    R_390 = 18
        R_390_PC32DBL     R_390 = 19
        R_390_PLT32DBL    R_390 = 20
        R_390_GOTPCDBL    R_390 = 21
        R_390_64          R_390 = 22
        R_390_PC64        R_390 = 23
        R_390_GOT64       R_390 = 24
        R_390_PLT64       R_390 = 25
        R_390_GOTENT      R_390 = 26
        R_390_GOTOFF16    R_390 = 27
        R_390_GOTOFF64    R_390 = 28
        R_390_GOTPLT12    R_390 = 29
        R_390_GOTPLT16    R_390 = 30
        R_390_GOTPLT32    R_390 = 31
        R_390_GOTPLT64    R_390 = 32
        R_390_GOTPLTENT   R_390 = 33
        R_390_GOTPLTOFF16 R_390 = 34
        R_390_GOTPLTOFF32 R_390 = 35
        R_390_GOTPLTOFF64 R_390 = 36
        R_390_TLS_LOAD    R_390 = 37
        R_390_TLS_GDCALL  R_390 = 38
        R_390_TLS_LDCALL  R_390 = 39
        R_390_TLS_GD32    R_390 = 40
        R_390_TLS_GD64    R_390 = 41
        R_390_TLS_GOTIE12 R_390 = 42
        R_390_TLS_GOTIE32 R_390 = 43
        R_390_TLS_GOTIE64 R_390 = 44
        R_390_TLS_LDM32   R_390 = 45
        R_390_TLS_LDM64   R_390 = 46
        R_390_TLS_IE32    R_390 = 47
        R_390_TLS_IE64    R_390 = 48
        R_390_TLS_IEENT   R_390 = 49
        R_390_TLS_LE32    R_390 = 50
        R_390_TLS_LE64    R_390 = 51
        R_390_TLS_LDO32   R_390 = 52
        R_390_TLS_LDO64   R_390 = 53
        R_390_TLS_DTPMOD  R_390 = 54
        R_390_TLS_DTPOFF  R_390 = 55
        R_390_TLS_TPOFF   R_390 = 56
        R_390_20          R_390 = 57
        R_390_GOT20       R_390 = 58
        R_390_GOTPLT20    R_390 = 59
        R_390_TLS_GOTIE20 R_390 = 60)

func (R_390) GoString

func (i R_390) GoString() string

func (R_390) String

func (i R_390) String() string

type R_AARCH64

AArch64(aka arm64)的重定位类型

type R_AARCH64 int
const (
        R_AARCH64_NONE                            R_AARCH64 = 0
        R_AARCH64_P32_ABS32                       R_AARCH64 = 1
        R_AARCH64_P32_ABS16                       R_AARCH64 = 2
        R_AARCH64_P32_PREL32                      R_AARCH64 = 3
        R_AARCH64_P32_PREL16                      R_AARCH64 = 4
        R_AARCH64_P32_MOVW_UABS_G0                R_AARCH64 = 5
        R_AARCH64_P32_MOVW_UABS_G0_NC             R_AARCH64 = 6
        R_AARCH64_P32_MOVW_UABS_G1                R_AARCH64 = 7
        R_AARCH64_P32_MOVW_SABS_G0                R_AARCH64 = 8
        R_AARCH64_P32_LD_PREL_LO19                R_AARCH64 = 9
        R_AARCH64_P32_ADR_PREL_LO21               R_AARCH64 = 10
        R_AARCH64_P32_ADR_PREL_PG_HI21            R_AARCH64 = 11
        R_AARCH64_P32_ADD_ABS_LO12_NC             R_AARCH64 = 12
        R_AARCH64_P32_LDST8_ABS_LO12_NC           R_AARCH64 = 13
        R_AARCH64_P32_LDST16_ABS_LO12_NC          R_AARCH64 = 14
        R_AARCH64_P32_LDST32_ABS_LO12_NC          R_AARCH64 = 15
        R_AARCH64_P32_LDST64_ABS_LO12_NC          R_AARCH64 = 16
        R_AARCH64_P32_LDST128_ABS_LO12_NC         R_AARCH64 = 17
        R_AARCH64_P32_TSTBR14                     R_AARCH64 = 18
        R_AARCH64_P32_CONDBR19                    R_AARCH64 = 19
        R_AARCH64_P32_JUMP26                      R_AARCH64 = 20
        R_AARCH64_P32_CALL26                      R_AARCH64 = 21
        R_AARCH64_P32_GOT_LD_PREL19               R_AARCH64 = 25
        R_AARCH64_P32_ADR_GOT_PAGE                R_AARCH64 = 26
        R_AARCH64_P32_LD32_GOT_LO12_NC            R_AARCH64 = 27
        R_AARCH64_P32_TLSGD_ADR_PAGE21            R_AARCH64 = 81
        R_AARCH64_P32_TLSGD_ADD_LO12_NC           R_AARCH64 = 82
        R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21   R_AARCH64 = 103
        R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC R_AARCH64 = 104
        R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19    R_AARCH64 = 105
        R_AARCH64_P32_TLSLE_MOVW_TPREL_G1         R_AARCH64 = 106
        R_AARCH64_P32_TLSLE_MOVW_TPREL_G0         R_AARCH64 = 107
        R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC      R_AARCH64 = 108
        R_AARCH64_P32_TLSLE_ADD_TPREL_HI12        R_AARCH64 = 109
        R_AARCH64_P32_TLSLE_ADD_TPREL_LO12        R_AARCH64 = 110
        R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC     R_AARCH64 = 111
        R_AARCH64_P32_TLSDESC_LD_PREL19           R_AARCH64 = 122
        R_AARCH64_P32_TLSDESC_ADR_PREL21          R_AARCH64 = 123
        R_AARCH64_P32_TLSDESC_ADR_PAGE21          R_AARCH64 = 124
        R_AARCH64_P32_TLSDESC_LD32_LO12_NC        R_AARCH64 = 125
        R_AARCH64_P32_TLSDESC_ADD_LO12_NC         R_AARCH64 = 126
        R_AARCH64_P32_TLSDESC_CALL                R_AARCH64 = 127
        R_AARCH64_P32_COPY                        R_AARCH64 = 180
        R_AARCH64_P32_GLOB_DAT                    R_AARCH64 = 181
        R_AARCH64_P32_JUMP_SLOT                   R_AARCH64 = 182
        R_AARCH64_P32_RELATIVE                    R_AARCH64 = 183
        R_AARCH64_P32_TLS_DTPMOD                  R_AARCH64 = 184
        R_AARCH64_P32_TLS_DTPREL                  R_AARCH64 = 185
        R_AARCH64_P32_TLS_TPREL                   R_AARCH64 = 186
        R_AARCH64_P32_TLSDESC                     R_AARCH64 = 187
        R_AARCH64_P32_IRELATIVE                   R_AARCH64 = 188
        R_AARCH64_NULL                            R_AARCH64 = 256
        R_AARCH64_ABS64                           R_AARCH64 = 257
        R_AARCH64_ABS32                           R_AARCH64 = 258
        R_AARCH64_ABS16                           R_AARCH64 = 259
        R_AARCH64_PREL64                          R_AARCH64 = 260
        R_AARCH64_PREL32                          R_AARCH64 = 261
        R_AARCH64_PREL16                          R_AARCH64 = 262
        R_AARCH64_MOVW_UABS_G0                    R_AARCH64 = 263
        R_AARCH64_MOVW_UABS_G0_NC                 R_AARCH64 = 264
        R_AARCH64_MOVW_UABS_G1                    R_AARCH64 = 265
        R_AARCH64_MOVW_UABS_G1_NC                 R_AARCH64 = 266
        R_AARCH64_MOVW_UABS_G2                    R_AARCH64 = 267
        R_AARCH64_MOVW_UABS_G2_NC                 R_AARCH64 = 268
        R_AARCH64_MOVW_UABS_G3                    R_AARCH64 = 269
        R_AARCH64_MOVW_SABS_G0                    R_AARCH64 = 270
        R_AARCH64_MOVW_SABS_G1                    R_AARCH64 = 271
        R_AARCH64_MOVW_SABS_G2                    R_AARCH64 = 272
        R_AARCH64_LD_PREL_LO19                    R_AARCH64 = 273
        R_AARCH64_ADR_PREL_LO21                   R_AARCH64 = 274
        R_AARCH64_ADR_PREL_PG_HI21                R_AARCH64 = 275
        R_AARCH64_ADR_PREL_PG_HI21_NC             R_AARCH64 = 276
        R_AARCH64_ADD_ABS_LO12_NC                 R_AARCH64 = 277
        R_AARCH64_LDST8_ABS_LO12_NC               R_AARCH64 = 278
        R_AARCH64_TSTBR14                         R_AARCH64 = 279
        R_AARCH64_CONDBR19                        R_AARCH64 = 280
        R_AARCH64_JUMP26                          R_AARCH64 = 282
        R_AARCH64_CALL26                          R_AARCH64 = 283
        R_AARCH64_LDST16_ABS_LO12_NC              R_AARCH64 = 284
        R_AARCH64_LDST32_ABS_LO12_NC              R_AARCH64 = 285
        R_AARCH64_LDST64_ABS_LO12_NC              R_AARCH64 = 286
        R_AARCH64_LDST128_ABS_LO12_NC             R_AARCH64 = 299
        R_AARCH64_GOT_LD_PREL19                   R_AARCH64 = 309
        R_AARCH64_ADR_GOT_PAGE                    R_AARCH64 = 311
        R_AARCH64_LD64_GOT_LO12_NC                R_AARCH64 = 312
        R_AARCH64_TLSGD_ADR_PAGE21                R_AARCH64 = 513
        R_AARCH64_TLSGD_ADD_LO12_NC               R_AARCH64 = 514
        R_AARCH64_TLSIE_MOVW_GOTTPREL_G1          R_AARCH64 = 539
        R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC       R_AARCH64 = 540
        R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21       R_AARCH64 = 541
        R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC     R_AARCH64 = 542
        R_AARCH64_TLSIE_LD_GOTTPREL_PREL19        R_AARCH64 = 543
        R_AARCH64_TLSLE_MOVW_TPREL_G2             R_AARCH64 = 544
        R_AARCH64_TLSLE_MOVW_TPREL_G1             R_AARCH64 = 545
        R_AARCH64_TLSLE_MOVW_TPREL_G1_NC          R_AARCH64 = 546
        R_AARCH64_TLSLE_MOVW_TPREL_G0             R_AARCH64 = 547
        R_AARCH64_TLSLE_MOVW_TPREL_G0_NC          R_AARCH64 = 548
        R_AARCH64_TLSLE_ADD_TPREL_HI12            R_AARCH64 = 549
        R_AARCH64_TLSLE_ADD_TPREL_LO12            R_AARCH64 = 550
        R_AARCH64_TLSLE_ADD_TPREL_LO12_NC         R_AARCH64 = 551
        R_AARCH64_TLSDESC_LD_PREL19               R_AARCH64 = 560
        R_AARCH64_TLSDESC_ADR_PREL21              R_AARCH64 = 561
        R_AARCH64_TLSDESC_ADR_PAGE21              R_AARCH64 = 562
        R_AARCH64_TLSDESC_LD64_LO12_NC            R_AARCH64 = 563
        R_AARCH64_TLSDESC_ADD_LO12_NC             R_AARCH64 = 564
        R_AARCH64_TLSDESC_OFF_G1                  R_AARCH64 = 565
        R_AARCH64_TLSDESC_OFF_G0_NC               R_AARCH64 = 566
        R_AARCH64_TLSDESC_LDR                     R_AARCH64 = 567
        R_AARCH64_TLSDESC_ADD                     R_AARCH64 = 568
        R_AARCH64_TLSDESC_CALL                    R_AARCH64 = 569
        R_AARCH64_COPY                            R_AARCH64 = 1024
        R_AARCH64_GLOB_DAT                        R_AARCH64 = 1025
        R_AARCH64_JUMP_SLOT                       R_AARCH64 = 1026
        R_AARCH64_RELATIVE                        R_AARCH64 = 1027
        R_AARCH64_TLS_DTPMOD64                    R_AARCH64 = 1028
        R_AARCH64_TLS_DTPREL64                    R_AARCH64 = 1029
        R_AARCH64_TLS_TPREL64                     R_AARCH64 = 1030
        R_AARCH64_TLSDESC                         R_AARCH64 = 1031
        R_AARCH64_IRELATIVE                       R_AARCH64 = 1032)

func (R_AARCH64) GoString

func (i R_AARCH64) GoString() string

func (R_AARCH64) String

func (i R_AARCH64) String() string

type R_ALPHA

Alpha的重新分配类型。

type R_ALPHA int
const (
        R_ALPHA_NONE           R_ALPHA = 0  /* 没有重新安置 */
        R_ALPHA_REFLONG        R_ALPHA = 1  /* Direct 32 bit */
        R_ALPHA_REFQUAD        R_ALPHA = 2  /* Direct 64 bit */
        R_ALPHA_GPREL32        R_ALPHA = 3  /* GP相对32位 */
        R_ALPHA_LITERAL        R_ALPHA = 4  /* GP相对16位w/optimization */
        R_ALPHA_LITUSE         R_ALPHA = 5  /* LITERAL的优化提示 */
        R_ALPHA_GPDISP         R_ALPHA = 6  /* 向GP添加排量 */
        R_ALPHA_BRADDR         R_ALPHA = 7  /* PC + 4相对23位移位 */
        R_ALPHA_HINT           R_ALPHA = 8  /* PC + 4相对16位移位 */
        R_ALPHA_SREL16         R_ALPHA = 9  /* PC相对16位 */
        R_ALPHA_SREL32         R_ALPHA = 10 /* PC相对32位 */
        R_ALPHA_SREL64         R_ALPHA = 11 /* PC相对64位 */
        R_ALPHA_OP_PUSH        R_ALPHA = 12 /* OP堆栈推送 */
        R_ALPHA_OP_STORE       R_ALPHA = 13 /* OP堆栈弹出和存储 */
        R_ALPHA_OP_PSUB        R_ALPHA = 14 /* OP堆栈减法 */
        R_ALPHA_OP_PRSHIFT     R_ALPHA = 15 /* OP堆栈右移 */
        R_ALPHA_GPVALUE        R_ALPHA = 16
        R_ALPHA_GPRELHIGH      R_ALPHA = 17
        R_ALPHA_GPRELLOW       R_ALPHA = 18
        R_ALPHA_IMMED_GP_16    R_ALPHA = 19
        R_ALPHA_IMMED_GP_HI32  R_ALPHA = 20
        R_ALPHA_IMMED_SCN_HI32 R_ALPHA = 21
        R_ALPHA_IMMED_BR_HI32  R_ALPHA = 22
        R_ALPHA_IMMED_LO32     R_ALPHA = 23
        R_ALPHA_COPY           R_ALPHA = 24 /* 在运行时复制符号 */
        R_ALPHA_GLOB_DAT       R_ALPHA = 25 /* 创建GOT条目 */
        R_ALPHA_JMP_SLOT       R_ALPHA = 26 /* 创建PLT条目 */
        R_ALPHA_RELATIVE       R_ALPHA = 27 /* 按程序库调整 */)

func (R_ALPHA) GoString

func (i R_ALPHA) GoString() string

func (R_ALPHA) String

func (i R_ALPHA) String() string

type R_ARM

为 ARM 重新分配类型。

type R_ARM int
const (
        R_ARM_NONE          R_ARM = 0 /* 没有迁移。 */
        R_ARM_PC24          R_ARM = 1
        R_ARM_ABS32         R_ARM = 2
        R_ARM_REL32         R_ARM = 3
        R_ARM_PC13          R_ARM = 4
        R_ARM_ABS16         R_ARM = 5
        R_ARM_ABS12         R_ARM = 6
        R_ARM_THM_ABS5      R_ARM = 7
        R_ARM_ABS8          R_ARM = 8
        R_ARM_SBREL32       R_ARM = 9
        R_ARM_THM_PC22      R_ARM = 10
        R_ARM_THM_PC8       R_ARM = 11
        R_ARM_AMP_VCALL9    R_ARM = 12
        R_ARM_SWI24         R_ARM = 13
        R_ARM_THM_SWI8      R_ARM = 14
        R_ARM_XPC25         R_ARM = 15
        R_ARM_THM_XPC22     R_ARM = 16
        R_ARM_COPY          R_ARM = 20 /* 从共享对象复制数据。 */
        R_ARM_GLOB_DAT      R_ARM = 21 /* 将GOT条目设置为数据地址。 */
        R_ARM_JUMP_SLOT     R_ARM = 22 /* 将GOT条目设置为代码地址。 */
        R_ARM_RELATIVE      R_ARM = 23 /* 添加共享对象的加载地址。 */
        R_ARM_GOTOFF        R_ARM = 24 /* 添加GOT相对符号地址。 */
        R_ARM_GOTPC         R_ARM = 25 /* 添加PC相对GOT表地址。 */
        R_ARM_GOT32         R_ARM = 26 /* 添加PC相对GOT偏移量。 */
        R_ARM_PLT32         R_ARM = 27 /* 添加PC相对PLT偏移量。 */
        R_ARM_GNU_VTENTRY   R_ARM = 100
        R_ARM_GNU_VTINHERIT R_ARM = 101
        R_ARM_RSBREL32      R_ARM = 250
        R_ARM_THM_RPC22     R_ARM = 251
        R_ARM_RREL32        R_ARM = 252
        R_ARM_RABS32        R_ARM = 253
        R_ARM_RPC24         R_ARM = 254
        R_ARM_RBASE         R_ARM = 255)

func (R_ARM) GoString

func (i R_ARM) GoString() string

func (R_ARM) String

func (i R_ARM) String() string

type R_MIPS

为 MIPS 重新安置类型。

type R_MIPS int
const (
        R_MIPS_NONE          R_MIPS = 0
        R_MIPS_16            R_MIPS = 1
        R_MIPS_32            R_MIPS = 2
        R_MIPS_REL32         R_MIPS = 3
        R_MIPS_26            R_MIPS = 4
        R_MIPS_HI16          R_MIPS = 5  /* 高16位的符号值 */
        R_MIPS_LO16          R_MIPS = 6  /* 低16位符号值 */
        R_MIPS_GPREL16       R_MIPS = 7  /* GP相对参考  */
        R_MIPS_LITERAL       R_MIPS = 8  /* 参考文字部分  */
        R_MIPS_GOT16         R_MIPS = 9  /* 引用全局偏移表 */
        R_MIPS_PC16          R_MIPS = 10 /* 16位PC相对参考 */
        R_MIPS_CALL16        R_MIPS = 11 /* 通过全局偏移表进行16位调用 */
        R_MIPS_GPREL32       R_MIPS = 12
        R_MIPS_SHIFT5        R_MIPS = 16
        R_MIPS_SHIFT6        R_MIPS = 17
        R_MIPS_64            R_MIPS = 18
        R_MIPS_GOT_DISP      R_MIPS = 19
        R_MIPS_GOT_PAGE      R_MIPS = 20
        R_MIPS_GOT_OFST      R_MIPS = 21
        R_MIPS_GOT_HI16      R_MIPS = 22
        R_MIPS_GOT_LO16      R_MIPS = 23
        R_MIPS_SUB           R_MIPS = 24
        R_MIPS_INSERT_A      R_MIPS = 25
        R_MIPS_INSERT_B      R_MIPS = 26
        R_MIPS_DELETE        R_MIPS = 27
        R_MIPS_HIGHER        R_MIPS = 28
        R_MIPS_HIGHEST       R_MIPS = 29
        R_MIPS_CALL_HI16     R_MIPS = 30
        R_MIPS_CALL_LO16     R_MIPS = 31
        R_MIPS_SCN_DISP      R_MIPS = 32
        R_MIPS_REL16         R_MIPS = 33
        R_MIPS_ADD_IMMEDIATE R_MIPS = 34
        R_MIPS_PJUMP         R_MIPS = 35
        R_MIPS_RELGOT        R_MIPS = 36
        R_MIPS_JALR          R_MIPS = 37

        R_MIPS_TLS_DTPMOD32    R_MIPS = 38 /* 模块编号32位 */
        R_MIPS_TLS_DTPREL32    R_MIPS = 39 /* 模块相对偏移32位 */
        R_MIPS_TLS_DTPMOD64    R_MIPS = 40 /* 模块编号64位 */
        R_MIPS_TLS_DTPREL64    R_MIPS = 41 /* 模块相对偏移64位 */
        R_MIPS_TLS_GD          R_MIPS = 42 /* GD的16位GOT偏移 */
        R_MIPS_TLS_LDM         R_MIPS = 43 /* LDM的16位GOT偏移 */
        R_MIPS_TLS_DTPREL_HI16 R_MIPS = 44 /* 模块相对偏移,高16位 */
        R_MIPS_TLS_DTPREL_LO16 R_MIPS = 45 /* 模块相对偏移,低16位 */
        R_MIPS_TLS_GOTTPREL    R_MIPS = 46 /* IE的16位GOT偏移 */
        R_MIPS_TLS_TPREL32     R_MIPS = 47 /* TP相对偏移,32位 */
        R_MIPS_TLS_TPREL64     R_MIPS = 48 /* TP相对偏移,64位 */
        R_MIPS_TLS_TPREL_HI16  R_MIPS = 49 /* TP相对偏移,高16位 */
        R_MIPS_TLS_TPREL_LO16  R_MIPS = 50 /* TP相对偏移,低16位 */)

func (R_MIPS) GoString

func (i R_MIPS) GoString() string

func (R_MIPS) String

func (i R_MIPS) String() string

type R_PPC

为PowerPC重新分配类型。

type R_PPC int
const (
        R_PPC_NONE            R_PPC = 0 /* 没有搬迁。 */
        R_PPC_ADDR32          R_PPC = 1
        R_PPC_ADDR24          R_PPC = 2
        R_PPC_ADDR16          R_PPC = 3
        R_PPC_ADDR16_LO       R_PPC = 4
        R_PPC_ADDR16_HI       R_PPC = 5
        R_PPC_ADDR16_HA       R_PPC = 6
        R_PPC_ADDR14          R_PPC = 7
        R_PPC_ADDR14_BRTAKEN  R_PPC = 8
        R_PPC_ADDR14_BRNTAKEN R_PPC = 9
        R_PPC_REL24           R_PPC = 10
        R_PPC_REL14           R_PPC = 11
        R_PPC_REL14_BRTAKEN   R_PPC = 12
        R_PPC_REL14_BRNTAKEN  R_PPC = 13
        R_PPC_GOT16           R_PPC = 14
        R_PPC_GOT16_LO        R_PPC = 15
        R_PPC_GOT16_HI        R_PPC = 16
        R_PPC_GOT16_HA        R_PPC = 17
        R_PPC_PLTREL24        R_PPC = 18
        R_PPC_COPY            R_PPC = 19
        R_PPC_GLOB_DAT        R_PPC = 20
        R_PPC_JMP_SLOT        R_PPC = 21
        R_PPC_RELATIVE        R_PPC = 22
        R_PPC_LOCAL24PC       R_PPC = 23
        R_PPC_UADDR32         R_PPC = 24
        R_PPC_UADDR16         R_PPC = 25
        R_PPC_REL32           R_PPC = 26
        R_PPC_PLT32           R_PPC = 27
        R_PPC_PLTREL32        R_PPC = 28
        R_PPC_PLT16_LO        R_PPC = 29
        R_PPC_PLT16_HI        R_PPC = 30
        R_PPC_PLT16_HA        R_PPC = 31
        R_PPC_SDAREL16        R_PPC = 32
        R_PPC_SECTOFF         R_PPC = 33
        R_PPC_SECTOFF_LO      R_PPC = 34
        R_PPC_SECTOFF_HI      R_PPC = 35
        R_PPC_SECTOFF_HA      R_PPC = 36
        R_PPC_TLS             R_PPC = 67
        R_PPC_DTPMOD32        R_PPC = 68
        R_PPC_TPREL16         R_PPC = 69
        R_PPC_TPREL16_LO      R_PPC = 70
        R_PPC_TPREL16_HI      R_PPC = 71
        R_PPC_TPREL16_HA      R_PPC = 72
        R_PPC_TPREL32         R_PPC = 73
        R_PPC_DTPREL16        R_PPC = 74
        R_PPC_DTPREL16_LO     R_PPC = 75
        R_PPC_DTPREL16_HI     R_PPC = 76
        R_PPC_DTPREL16_HA     R_PPC = 77
        R_PPC_DTPREL32        R_PPC = 78
        R_PPC_GOT_TLSGD16     R_PPC = 79
        R_PPC_GOT_TLSGD16_LO  R_PPC = 80
        R_PPC_GOT_TLSGD16_HI  R_PPC = 81
        R_PPC_GOT_TLSGD16_HA  R_PPC = 82
        R_PPC_GOT_TLSLD16     R_PPC = 83
        R_PPC_GOT_TLSLD16_LO  R_PPC = 84
        R_PPC_GOT_TLSLD16_HI  R_PPC = 85
        R_PPC_GOT_TLSLD16_HA  R_PPC = 86
        R_PPC_GOT_TPREL16     R_PPC = 87
        R_PPC_GOT_TPREL16_LO  R_PPC = 88
        R_PPC_GOT_TPREL16_HI  R_PPC = 89
        R_PPC_GOT_TPREL16_HA  R_PPC = 90
        R_PPC_EMB_NADDR32     R_PPC = 101
        R_PPC_EMB_NADDR16     R_PPC = 102
        R_PPC_EMB_NADDR16_LO  R_PPC = 103
        R_PPC_EMB_NADDR16_HI  R_PPC = 104
        R_PPC_EMB_NADDR16_HA  R_PPC = 105
        R_PPC_EMB_SDAI16      R_PPC = 106
        R_PPC_EMB_SDA2I16     R_PPC = 107
        R_PPC_EMB_SDA2REL     R_PPC = 108
        R_PPC_EMB_SDA21       R_PPC = 109
        R_PPC_EMB_MRKREF      R_PPC = 110
        R_PPC_EMB_RELSEC16    R_PPC = 111
        R_PPC_EMB_RELST_LO    R_PPC = 112
        R_PPC_EMB_RELST_HI    R_PPC = 113
        R_PPC_EMB_RELST_HA    R_PPC = 114
        R_PPC_EMB_BIT_FLD     R_PPC = 115
        R_PPC_EMB_RELSDA      R_PPC = 116)

func (R_PPC) GoString

func (i R_PPC) GoString() string

func (R_PPC) String

func (i R_PPC) String() string

type R_PPC64

64位PowerPC 或 Power Architecture 处理器重新分配类型。

type R_PPC64 int
const (
        R_PPC64_NONE               R_PPC64 = 0
        R_PPC64_ADDR32             R_PPC64 = 1
        R_PPC64_ADDR24             R_PPC64 = 2
        R_PPC64_ADDR16             R_PPC64 = 3
        R_PPC64_ADDR16_LO          R_PPC64 = 4
        R_PPC64_ADDR16_HI          R_PPC64 = 5
        R_PPC64_ADDR16_HA          R_PPC64 = 6
        R_PPC64_ADDR14             R_PPC64 = 7
        R_PPC64_ADDR14_BRTAKEN     R_PPC64 = 8
        R_PPC64_ADDR14_BRNTAKEN    R_PPC64 = 9
        R_PPC64_REL24              R_PPC64 = 10
        R_PPC64_REL14              R_PPC64 = 11
        R_PPC64_REL14_BRTAKEN      R_PPC64 = 12
        R_PPC64_REL14_BRNTAKEN     R_PPC64 = 13
        R_PPC64_GOT16              R_PPC64 = 14
        R_PPC64_GOT16_LO           R_PPC64 = 15
        R_PPC64_GOT16_HI           R_PPC64 = 16
        R_PPC64_GOT16_HA           R_PPC64 = 17
        R_PPC64_JMP_SLOT           R_PPC64 = 21
        R_PPC64_REL32              R_PPC64 = 26
        R_PPC64_ADDR64             R_PPC64 = 38
        R_PPC64_ADDR16_HIGHER      R_PPC64 = 39
        R_PPC64_ADDR16_HIGHERA     R_PPC64 = 40
        R_PPC64_ADDR16_HIGHEST     R_PPC64 = 41
        R_PPC64_ADDR16_HIGHESTA    R_PPC64 = 42
        R_PPC64_REL64              R_PPC64 = 44
        R_PPC64_TOC16              R_PPC64 = 47
        R_PPC64_TOC16_LO           R_PPC64 = 48
        R_PPC64_TOC16_HI           R_PPC64 = 49
        R_PPC64_TOC16_HA           R_PPC64 = 50
        R_PPC64_TOC                R_PPC64 = 51
        R_PPC64_ADDR16_DS          R_PPC64 = 56
        R_PPC64_ADDR16_LO_DS       R_PPC64 = 57
        R_PPC64_GOT16_DS           R_PPC64 = 58
        R_PPC64_GOT16_LO_DS        R_PPC64 = 59
        R_PPC64_TOC16_DS           R_PPC64 = 63
        R_PPC64_TOC16_LO_DS        R_PPC64 = 64
        R_PPC64_TLS                R_PPC64 = 67
        R_PPC64_DTPMOD64           R_PPC64 = 68
        R_PPC64_TPREL16            R_PPC64 = 69
        R_PPC64_TPREL16_LO         R_PPC64 = 70
        R_PPC64_TPREL16_HI         R_PPC64 = 71
        R_PPC64_TPREL16_HA         R_PPC64 = 72
        R_PPC64_TPREL64            R_PPC64 = 73
        R_PPC64_DTPREL16           R_PPC64 = 74
        R_PPC64_DTPREL16_LO        R_PPC64 = 75
        R_PPC64_DTPREL16_HI        R_PPC64 = 76
        R_PPC64_DTPREL16_HA        R_PPC64 = 77
        R_PPC64_DTPREL64           R_PPC64 = 78
        R_PPC64_GOT_TLSGD16        R_PPC64 = 79
        R_PPC64_GOT_TLSGD16_LO     R_PPC64 = 80
        R_PPC64_GOT_TLSGD16_HI     R_PPC64 = 81
        R_PPC64_GOT_TLSGD16_HA     R_PPC64 = 82
        R_PPC64_GOT_TLSLD16        R_PPC64 = 83
        R_PPC64_GOT_TLSLD16_LO     R_PPC64 = 84
        R_PPC64_GOT_TLSLD16_HI     R_PPC64 = 85
        R_PPC64_GOT_TLSLD16_HA     R_PPC64 = 86
        R_PPC64_GOT_TPREL16_DS     R_PPC64 = 87
        R_PPC64_GOT_TPREL16_LO_DS  R_PPC64 = 88
        R_PPC64_GOT_TPREL16_HI     R_PPC64 = 89
        R_PPC64_GOT_TPREL16_HA     R_PPC64 = 90
        R_PPC64_GOT_DTPREL16_DS    R_PPC64 = 91
        R_PPC64_GOT_DTPREL16_LO_DS R_PPC64 = 92
        R_PPC64_GOT_DTPREL16_HI    R_PPC64 = 93
        R_PPC64_GOT_DTPREL16_HA    R_PPC64 = 94
        R_PPC64_TPREL16_DS         R_PPC64 = 95
        R_PPC64_TPREL16_LO_DS      R_PPC64 = 96
        R_PPC64_TPREL16_HIGHER     R_PPC64 = 97
        R_PPC64_TPREL16_HIGHERA    R_PPC64 = 98
        R_PPC64_TPREL16_HIGHEST    R_PPC64 = 99
        R_PPC64_TPREL16_HIGHESTA   R_PPC64 = 100
        R_PPC64_DTPREL16_DS        R_PPC64 = 101
        R_PPC64_DTPREL16_LO_DS     R_PPC64 = 102
        R_PPC64_DTPREL16_HIGHER    R_PPC64 = 103
        R_PPC64_DTPREL16_HIGHERA   R_PPC64 = 104
        R_PPC64_DTPREL16_HIGHEST   R_PPC64 = 105
        R_PPC64_DTPREL16_HIGHESTA  R_PPC64 = 106
        R_PPC64_TLSGD              R_PPC64 = 107
        R_PPC64_TLSLD              R_PPC64 = 108
        R_PPC64_REL16              R_PPC64 = 249
        R_PPC64_REL16_LO           R_PPC64 = 250
        R_PPC64_REL16_HI           R_PPC64 = 251
        R_PPC64_REL16_HA           R_PPC64 = 252)

func (R_PPC64) GoString

func (i R_PPC64) GoString() string

func (R_PPC64) String

func (i R_PPC64) String() string

type R_SPARC

SPARC 重新分配类型。

type R_SPARC int
const (
        R_SPARC_NONE     R_SPARC = 0
        R_SPARC_8        R_SPARC = 1
        R_SPARC_16       R_SPARC = 2
        R_SPARC_32       R_SPARC = 3
        R_SPARC_DISP8    R_SPARC = 4
        R_SPARC_DISP16   R_SPARC = 5
        R_SPARC_DISP32   R_SPARC = 6
        R_SPARC_WDISP30  R_SPARC = 7
        R_SPARC_WDISP22  R_SPARC = 8
        R_SPARC_HI22     R_SPARC = 9
        R_SPARC_22       R_SPARC = 10
        R_SPARC_13       R_SPARC = 11
        R_SPARC_LO10     R_SPARC = 12
        R_SPARC_GOT10    R_SPARC = 13
        R_SPARC_GOT13    R_SPARC = 14
        R_SPARC_GOT22    R_SPARC = 15
        R_SPARC_PC10     R_SPARC = 16
        R_SPARC_PC22     R_SPARC = 17
        R_SPARC_WPLT30   R_SPARC = 18
        R_SPARC_COPY     R_SPARC = 19
        R_SPARC_GLOB_DAT R_SPARC = 20
        R_SPARC_JMP_SLOT R_SPARC = 21
        R_SPARC_RELATIVE R_SPARC = 22
        R_SPARC_UA32     R_SPARC = 23
        R_SPARC_PLT32    R_SPARC = 24
        R_SPARC_HIPLT22  R_SPARC = 25
        R_SPARC_LOPLT10  R_SPARC = 26
        R_SPARC_PCPLT32  R_SPARC = 27
        R_SPARC_PCPLT22  R_SPARC = 28
        R_SPARC_PCPLT10  R_SPARC = 29
        R_SPARC_10       R_SPARC = 30
        R_SPARC_11       R_SPARC = 31
        R_SPARC_64       R_SPARC = 32
        R_SPARC_OLO10    R_SPARC = 33
        R_SPARC_HH22     R_SPARC = 34
        R_SPARC_HM10     R_SPARC = 35
        R_SPARC_LM22     R_SPARC = 36
        R_SPARC_PC_HH22  R_SPARC = 37
        R_SPARC_PC_HM10  R_SPARC = 38
        R_SPARC_PC_LM22  R_SPARC = 39
        R_SPARC_WDISP16  R_SPARC = 40
        R_SPARC_WDISP19  R_SPARC = 41
        R_SPARC_GLOB_JMP R_SPARC = 42
        R_SPARC_7        R_SPARC = 43
        R_SPARC_5        R_SPARC = 44
        R_SPARC_6        R_SPARC = 45
        R_SPARC_DISP64   R_SPARC = 46
        R_SPARC_PLT64    R_SPARC = 47
        R_SPARC_HIX22    R_SPARC = 48
        R_SPARC_LOX10    R_SPARC = 49
        R_SPARC_H44      R_SPARC = 50
        R_SPARC_M44      R_SPARC = 51
        R_SPARC_L44      R_SPARC = 52
        R_SPARC_REGISTER R_SPARC = 53
        R_SPARC_UA64     R_SPARC = 54
        R_SPARC_UA16     R_SPARC = 55)

func (R_SPARC) GoString

func (i R_SPARC) GoString() string

func (R_SPARC) String

func (i R_SPARC) String() string

type R_X86_64

x86-64 重新分配类型。

type R_X86_64 int
const (
        R_X86_64_NONE     R_X86_64 = 0  /* 没有搬迁。 */
        R_X86_64_64       R_X86_64 = 1  /* 添加64位符号值。 */
        R_X86_64_PC32     R_X86_64 = 2  /* PC相对32位签名sym值。 */
        R_X86_64_GOT32    R_X86_64 = 3  /* PC相对32位GOT偏移。 */
        R_X86_64_PLT32    R_X86_64 = 4  /* PC相对32位PLT偏移。 */
        R_X86_64_COPY     R_X86_64 = 5  /* 从共享对象复制数据。 */
        R_X86_64_GLOB_DAT R_X86_64 = 6  /* 将GOT条目设置为数据地址。 */
        R_X86_64_JMP_SLOT R_X86_64 = 7  /* 将GOT条目设置为代码地址。 */
        R_X86_64_RELATIVE R_X86_64 = 8  /* 添加共享对象的加载地址。 */
        R_X86_64_GOTPCREL R_X86_64 = 9  /* 将32位带符号的pcrel偏移量添加到GOT。 */
        R_X86_64_32       R_X86_64 = 10 /* 添加32位零扩展符号值 */
        R_X86_64_32S      R_X86_64 = 11 /* 添加32位符号扩展符号值 */
        R_X86_64_16       R_X86_64 = 12 /* 添加16位零扩展符号值 */
        R_X86_64_PC16     R_X86_64 = 13 /* 添加16位带符号的扩展pc相对符号值 */
        R_X86_64_8        R_X86_64 = 14 /* 添加8位零扩展符号值 */
        R_X86_64_PC8      R_X86_64 = 15 /* 添加8位带符号的扩展pc相对符号值 */
        R_X86_64_DTPMOD64 R_X86_64 = 16 /* 包含符号的模块的ID */
        R_X86_64_DTPOFF64 R_X86_64 = 17 /* TLS块中的偏移量 */
        R_X86_64_TPOFF64  R_X86_64 = 18 /* TLS块中的偏移量 */
        R_X86_64_TLSGD    R_X86_64 = 19 /* PC相对偏移到GD GOT条目 */
        R_X86_64_TLSLD    R_X86_64 = 20 /* PC相对偏移到LD GOT条目 */
        R_X86_64_DTPOFF32 R_X86_64 = 21 /* TLS块中的偏移量 */
        R_X86_64_GOTTPOFF R_X86_64 = 22 /* IE相对偏移到IE GOT条目 */
        R_X86_64_TPOFF32  R_X86_64 = 23 /* 静态TLS块中的偏移量 */)

func (R_X86_64) GoString

func (i R_X86_64) GoString() string

func (R_X86_64) String

func (i R_X86_64) String() string

type Rel32

ELF32 不需要加数字段的重定位。

type Rel32 struct {
        Off  uint32 /* 要重新安置的位置。 */
        Info uint32 /* 重定位类型和符号索引。 */}

type Rel64

不需要加数字段的 ELF64 重定位。

type Rel64 struct {
        Off  uint64 /* 要重新安置的位置。 */
        Info uint64 /* 重定位类型和符号索引。 */}

type Rela32

需要加数字段的 ELF32 重定位。

type Rela32 struct {
        Off    uint32 /* 要重新安置的位置。 */
        Info   uint32 /* 重定位类型和符号索引。 */
        Addend int32  /* 加数。 */}

type Rela64

需要加数字段的 ELF64 重定位。

type Rela64 struct {
        Off    uint64 /* 要重新安置的位置。 */
        Info   uint64 /* 重定位类型和符号索引。 */
        Addend int64  /* 加数。 */}

type Section

Section 代表 ELF 文件中的单个节。

type Section struct {
        SectionHeader        // 为ReadAt方法嵌入ReaderAt。        // 不要直接嵌入SectionReader        // 避免阅读和寻求。        // 如果客户想要阅读和寻求它必须使用        // Open() 避免争夺寻求抵消        // 与其他客户端。        //        // 如果该部分不容易获得,ReaderAt可能为零        // 以随机访问形式。 例如,压缩部分        // 可能没有阅读器。
        io.ReaderAt        // 包含过滤或未导出的字段}

func (*Section) Data

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

数据读取并返回 ELF 部分的内容。即使该部分被压缩存储在ELF文件中,数据也会返回未压缩的数据。

func (*Section) Open

func (s *Section) Open() io.ReadSeeker

Open 返回读取 ELF 部分的新 ReadSeeker。即使该部分被压缩存储在 ELF 文件中,ReadSeeker 也会读取未压缩的数据。

type Section32

ELF32 部分标题。

type Section32 struct {
        Name      uint32 /* 节名称(节标题字符串表的索引)。 */
        Type      uint32 /* 节类型。 */
        Flags     uint32 /* 节标志。 */
        Addr      uint32 /* 内存映像中的地址。 */
        Off       uint32 /* 文件中的偏移量。 */
        Size      uint32 /* 大小以字节为单位 */
        Link      uint32 /* 相关部分的索引。 */
        Info      uint32 /* 取决于部分类型。 */
        Addralign uint32 /* 以字节为单位对齐。 */
        Entsize   uint32 /* 部分中每个条目的大小。 */}

type Section64

ELF64 部分标题。

type Section64 struct {
        Name      uint32 /* 节名称(节标题字符串表的索引)。 */
        Type      uint32 /* 节类型。 */
        Flags     uint64 /* 节标志。 */
        Addr      uint64 /* 内存映像中的地址。 */
        Off       uint64 /* 文件中的偏移量。 */
        Size      uint64 /* 大小以字节为单位 */
        Link      uint32 /* 相关部分的索引。 */
        Info      uint32 /* 取决于部分类型。 */
        Addralign uint64 /* 以字节为单位对齐。 */
        Entsize   uint64 /* 部分中每个条目的大小。*/}

type SectionFlag

节标志。

type SectionFlag uint32
const (
        SHF_WRITE            SectionFlag = 0x1        /* 节包含可写数据。 */
        SHF_ALLOC            SectionFlag = 0x2        /* 节占据记忆。 */
        SHF_EXECINSTR        SectionFlag = 0x4        /* 节包含说明。 */
        SHF_MERGE            SectionFlag = 0x10       /* 节可以合并。 */
        SHF_STRINGS          SectionFlag = 0x20       /* 节包含字符串。 */
        SHF_INFO_LINK        SectionFlag = 0x40       /* sh_info保存部分索引。 */
        SHF_LINK_ORDER       SectionFlag = 0x80       /* 特殊订购要求。 */
        SHF_OS_NONCONFORMING SectionFlag = 0x100      /* 需要特定于OS的处理。 */
        SHF_GROUP            SectionFlag = 0x200      /* 节组成员。 */
        SHF_TLS              SectionFlag = 0x400      /* 节包含TLS数据。 */
        SHF_COMPRESSED       SectionFlag = 0x800      /* 节是压缩的。 */
        SHF_MASKOS           SectionFlag = 0x0ff00000 /* 特定于操作系统的语义。 */
        SHF_MASKPROC         SectionFlag = 0xf0000000 /* 特定于处理器的语义。 */)

func (SectionFlag) GoString

func (i SectionFlag) GoString() string

func (SectionFlag) String

func (i SectionFlag) String() string

type SectionHeader

SectionHeader 表示单个 ELF 节标题。

type SectionHeader struct {
        Name      string
        Type      SectionType
        Flags     SectionFlag
        Addr      uint64
        Offset    uint64
        Size      uint64
        Link      uint32
        Info      uint32
        Addralign uint64
        Entsize   uint64        // FileSize是文件中此部分的大小(以字节为单位)。        // 如果某个部分被压缩,则FileSize的大小为        // 压缩数据,而Size(上面)是大小
        FileSize uint64}

type SectionIndex

特节指数。

type SectionIndex int
const (
        SHN_UNDEF     SectionIndex = 0      /* 未定义,缺失,无关紧要。 */
        SHN_LORESERVE SectionIndex = 0xff00 /* 保留范围的第一个。 */
        SHN_LOPROC    SectionIndex = 0xff00 /* 第一个特定于处理器。 */
        SHN_HIPROC    SectionIndex = 0xff1f /* 最后一个特定于处理器 */
        SHN_LOOS      SectionIndex = 0xff20 /* 第一个特定于操作系统。 */
        SHN_HIOS      SectionIndex = 0xff3f /* 最后一个特定于操作系统。 */
        SHN_ABS       SectionIndex = 0xfff1 /* 绝对值。 */
        SHN_COMMON    SectionIndex = 0xfff2 /* 常见数据。 */
        SHN_XINDEX    SectionIndex = 0xffff /* 转义; 索引存储在别处。 */
        SHN_HIRESERVE SectionIndex = 0xffff /* 最后保留的范围。 */)

func (SectionIndex) GoString

func (i SectionIndex) GoString() string

func (SectionIndex) String

func (i SectionIndex) String() string

type SectionType

Section 类型。

type SectionType uint32
const (
        SHT_NULL           SectionType = 0          /* 待用 */
        SHT_PROGBITS       SectionType = 1          /* 程序定义的信息 */
        SHT_SYMTAB         SectionType = 2          /* 符号表部分 */
        SHT_STRTAB         SectionType = 3          /* 字符串表部分 */
        SHT_RELA           SectionType = 4          /* 带加数的搬迁部分 */
        SHT_HASH           SectionType = 5          /* 符号哈希表部分 */
        SHT_DYNAMIC        SectionType = 6          /* 动态部分 */
        SHT_NOTE           SectionType = 7          /* 注意部分 */
        SHT_NOBITS         SectionType = 8          /* 没有空间部分 */
        SHT_REL            SectionType = 9          /* 迁移部分 - 没有加数 */
        SHT_SHLIB          SectionType = 10         /* 保留 - 目的未知 */
        SHT_DYNSYM         SectionType = 11         /* 动态符号表部分 */
        SHT_INIT_ARRAY     SectionType = 14         /* 初始化函数指针。 */
        SHT_FINI_ARRAY     SectionType = 15         /* 终止函数指针。 */
        SHT_PREINIT_ARRAY  SectionType = 16         /* 预初始化函数ptrs。 */
        SHT_GROUP          SectionType = 17         /* 科组。 */
        SHT_SYMTAB_SHNDX   SectionType = 18         /* 节索引(参见SHN_XINDEX)。 */
        SHT_LOOS           SectionType = 0x60000000 /* OS特定语义的第一个 */
        SHT_GNU_ATTRIBUTES SectionType = 0x6ffffff5 /* GNU对象属性 */
        SHT_GNU_HASH       SectionType = 0x6ffffff6 /* GNU哈希表 */
        SHT_GNU_LIBLIST    SectionType = 0x6ffffff7 /* GNU预链接库列表 */
        SHT_GNU_VERDEF     SectionType = 0x6ffffffd /* GNU版本定义部分 */
        SHT_GNU_VERNEED    SectionType = 0x6ffffffe /* GNU版本需要部分 */
        SHT_GNU_VERSYM     SectionType = 0x6fffffff /* GNU版本符号表 */
        SHT_HIOS           SectionType = 0x6fffffff /* 最后的OS特定语义 */
        SHT_LOPROC         SectionType = 0x70000000 /* 处理器的保留范围 */
        SHT_HIPROC         SectionType = 0x7fffffff /* 特定节头类型 */
        SHT_LOUSER         SectionType = 0x80000000 /* 保留范围的申请 */
        SHT_HIUSER         SectionType = 0xffffffff /* 具体指标 */)

func (SectionType) GoString

func (i SectionType) GoString() string

func (SectionType) String

func (i SectionType) String() string

type Sym32

ELF32 符号。

type Sym32 struct {
        Name  uint32
        Value uint32
        Size  uint32
        Info  uint8
        Other uint8
        Shndx uint16}

type Sym64

ELF64 符号表条目。

type Sym64 struct {
        Name  uint32 /* 字符串表索引的名称。 */
        Info  uint8  /* 类型和绑定信息。*/
        Other uint8  /* 保留(未使用)。 */
        Shndx uint16 /* 符号的部分索引。 */
        Value uint64 /* 符号值。 */
        Size  uint64 /* 关联对象的大小。 */}

type SymBind

Symbol Binding - ELFNN_ST_BIND - st_info

type SymBind int
const (
        STB_LOCAL  SymBind = 0  /* 本地符号 */
        STB_GLOBAL SymBind = 1  /* 全局符号 */
        STB_WEAK   SymBind = 2  /* 像全局 - 更低的优先权 */
        STB_LOOS   SymBind = 10 /* 操作系统的保留范围 */
        STB_HIOS   SymBind = 12 /*   具体的语义。 */
        STB_LOPROC SymBind = 13 /* 处理器的保留范围 */
        STB_HIPROC SymBind = 15 /*   具体的语义。 */)

func ST_BIND

func ST_BIND(info uint8) SymBind

func (SymBind) GoString

func (i SymBind) GoString() string

func (SymBind) String

func (i SymBind) String() string

type SymType

Symbol type - ELFNN_ST_TYPE - st_info

type SymType int
const (
        STT_NOTYPE  SymType = 0  /* 未指定的类型。 */
        STT_OBJECT  SymType = 1  /* 数据对象。 */
        STT_FUNC    SymType = 2  /* 函数。 */
        STT_SECTION SymType = 3  /* 部分。 */
        STT_FILE    SymType = 4  /* 源文件。 */
        STT_COMMON  SymType = 5  /* 未初始化的常见块。 */
        STT_TLS     SymType = 6  /* TLS对象。 */
        STT_LOOS    SymType = 10 /* 操作系统的保留范围 */
        STT_HIOS    SymType = 12 /*   具体的语义。 */
        STT_LOPROC  SymType = 13 /* 处理器的保留范围 */
        STT_HIPROC  SymType = 15 /*   具体的语义。 */)

func ST_TYPE

func ST_TYPE(info uint8) SymType

func (SymType) GoString

func (i SymType) GoString() string

func (SymType) String

func (i SymType) String() string

type SymVis

Symbol visibility - ELFNN_ST_VISIBILITY - st_other

type SymVis int
const (
        STV_DEFAULT   SymVis = 0x0 /* 默认可见性(请参阅binding 绑定)。 */
        STV_INTERNAL  SymVis = 0x1 /* 可重定位对象的特殊含义。 */
        STV_HIDDEN    SymVis = 0x2 /* 不可见。 */
        STV_PROTECTED SymVis = 0x3 /* 可见但不可抢占。 */)

func ST_VISIBILITY

func ST_VISIBILITY(other uint8) SymVis

func (SymVis) GoString

func (i SymVis) GoString() string

func (SymVis) String

func (i SymVis) String() string

type Symbol

符号表示ELF符号表部分中的条目。

type Symbol struct {
        Name        string
        Info, Other byte
        Section     SectionIndex
        Value, Size uint64}

type Type

类型在 Header.Type 中找到。

type Type uint16
const (
        ET_NONE   Type = 0      /* 未知类型。 */
        ET_REL    Type = 1      /* 重定位。 */
        ET_EXEC   Type = 2      /* 可执行文件。 */
        ET_DYN    Type = 3      /* 共享对象。 */
        ET_CORE   Type = 4      /* 核心文件。 */
        ET_LOOS   Type = 0xfe00 /* 第一个操作系统特定。 */
        ET_HIOS   Type = 0xfeff /* 最后一个特定于操作系统。 */
        ET_LOPROC Type = 0xff00 /* 第一个特定于处理器。 */
        ET_HIPROC Type = 0xffff /* 最后一个特定于处理器 */)

func (Type) GoString

func (i Type) GoString() string

func (Type) String

func (i Type) String() string

type Version

版本位于 Header.IdentEI_VERSION 和 Header.Version 中。

type Version byte
const (
        EV_NONE    Version = 0
        EV_CURRENT Version = 1)

func (Version) GoString

func (i Version) GoString() string

func (Version) String

func (i Version) String() string


上一篇: 下一篇: