Skip to main content

Module symbol_edit

Module symbol_edit 

Source
Expand description

Binary-level symbol editing for staticlib post-processing.

  • Hide: sets STV_HIDDEN (ELF) or N_PEXT (Mach-O) on non-exported symbols.
  • Rename: appends a vendor-specific suffix to non-exported symbol names by rebuilding the string table.

Re-exportsยง

use std::borrow::Cow; ๐Ÿ”’
use std::mem; ๐Ÿ”’
use object::read::coff::CoffHeader; ๐Ÿ”’
use object::read::coff::ImageSymbol as _; ๐Ÿ”’
use object::read::elf::SectionHeader as _; ๐Ÿ”’
use object::read::elf::Sym as _; ๐Ÿ”’
use object::read::macho::Nlist; ๐Ÿ”’
use object::Endianness; ๐Ÿ”’
use object::elf; ๐Ÿ”’
use object::macho; ๐Ÿ”’
use object::pe; ๐Ÿ”’
use rustc_data_structures::fx::FxHashMap; ๐Ÿ”’
use rustc_data_structures::fx::FxHashSet; ๐Ÿ”’
use rustc_middle::middle::exported_symbols::SymbolExportKind; ๐Ÿ”’
use super::symbol_export::undecorate_coff_symbol; ๐Ÿ”’

Structsยง

Patch ๐Ÿ”’
RenameEntry ๐Ÿ”’

Functionsยง

apply_edits ๐Ÿ”’
build_renamed_strtab ๐Ÿ”’
coff_collect_impl ๐Ÿ”’
coff_edit_impl ๐Ÿ”’
coff_symbol_kind ๐Ÿ”’
The SymbolExportKind of a COFF symbol, so #-prefixed Arm64EC text symbols are told apart from data symbols during undecoration.
collect_internal_names ๐Ÿ”’
elf_collect_impl ๐Ÿ”’
elf_edit_impl ๐Ÿ”’
elf_rebuild_strtab ๐Ÿ”’
macho_collect_impl ๐Ÿ”’
macho_edit_impl ๐Ÿ”’
macho_rebuild_strtab ๐Ÿ”’
write_u32_at ๐Ÿ”’
write_u64_at ๐Ÿ”’