elflib
Version:
ELF file reader and writer
53 lines (52 loc) • 2.33 kB
TypeScript
import { uint8, uint16, uint32, uint64 } from './primitive.js';
import * as Enums from './enums.js';
import { Structs } from './structs.js';
import { File } from './index.js';
/** Breakdown of symbol information stored on {@link Structs.Symbol._info} */
export interface SymbolInfo {
binding: Enums.SymbolBinding;
type: Enums.SymbolType;
}
/** A symbol, parsed from a symbol table. */
export declare class Symbol extends Structs.Symbol {
constructor(symbolSection: number);
/** The section index of the symbol section this symbol is from */
private readonly symSection;
/** Get the symbol's name. */
getName(elf: File): string;
/** The calculated virtual address for the symbol, if possible. */
virtualAddress?: uint32 | uint64;
/** The data for the symbol, if any and only if it was specified to be loaded. */
data?: Uint8Array;
/** The binding type of this symbol */
get binding(): Enums.SymbolBinding;
/** The type of this symbol */
get type(): Enums.SymbolType;
/** The visibility of the symbol. */
get visibility(): Enums.SymbolVisibility;
/** Offset from the start of the {@link Section.link linked string table section} of
* this symbol's section, to the address of this symbol's name in said table, if any. */
get nameOffset(): uint32;
/** The value of this symbol. The interpretation of the value is dependent on a few things but is generally an offset or address. */
get value(): uint32 | uint64;
/** The size of this symbol, if applicable. */
get size(): uint32;
/** Symbol type specific information. */
get info(): uint8 | SymbolInfo;
/** Other symbol information. */
get other(): uint8;
/** Section index for this symbol.
* @summary This is the index of the section for this symbol. There
* are also special values such as 0xFFF1 for an absolute index symbol
* in a relocatable ELF file (object file). */
get shndx(): uint16;
set binding(binding: Enums.SymbolBinding);
set type(type: Enums.SymbolType);
set visibility(visibility: Enums.SymbolVisibility);
set nameOffset(nameOffset: uint32);
set value(value: uint32 | uint64);
set size(size: uint32);
set info(info: uint8 | SymbolInfo);
set other(other: uint8);
set shndx(shndx: uint16);
}