binary

package
v2.0.6 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package binary provides binary file manipulation utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadBuildID

func ReadBuildID(path string) string

ReadBuildID reads the ELF build-id from the given binary. Returns an empty string if the binary has no build-id.

func SeparateDebugInfo

func SeparateDebugInfo(binary, debugDir string) (string, error)

SeparateDebugInfo extracts debug information from the binary into a separate file organized by build-id, then adds a .gnu_debuglink to the original binary. The debug file is stored at <debugDir>/.build-id/<prefix>/<suffix>.debug. Returns the path to the debug file, or empty string if no build-id was found.

func StripFile

func StripFile(path string, args ...string) error

StripFile removes debugging symbols from a binary file. It respects the STRIP environment variable for cross-compilation support.

func StripLTO

func StripLTO(path string, args ...string) error

StripLTO removes LTO (Link Time Optimization) sections from a binary file. It respects the STRIP environment variable for cross-compilation support.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL