Expand description
ELF binary analysis and copying utilities.
Uses readelf -d instead of ldd to extract library dependencies.
This works for cross-compilation since readelf reads ELF headers directly
without executing the binary (which ldd does via the host dynamic linker).
Functions§
- copy_
dir_ recursive - Copy a directory recursively, handling symlinks.
- copy_
library_ to - Copy a library from source to destination, handling symlinks.
- create_
symlink_ if_ missing - Create a symlink if it doesn’t already exist.
- find_
binary - Find a binary in standard bin/sbin directories.
- find_
library - Find a library in standard paths within a rootfs.
- find_
sbin_ binary - Find a binary, prioritizing sbin directories.
- get_
all_ dependencies - Recursively get all library dependencies (including transitive).
- get_
library_ dependencies - Extract library dependencies from an ELF binary using readelf.
- make_
executable - Make a file executable (chmod 755).
- parse_
readelf_ output - Parse readelf -d output to extract NEEDED library names.