HomeFreeBSD

Fix ldd to work with more ELF files.

Description

Fix ldd to work with more ELF files.

  • Use libelf to parse ELF data structures and remove code duplication for ELF32.
  • Don't require the OSABI field to be set to the FreeBSD OSABI for shared libraries. Both AArch64 and RISC-V leave it set to "none" and instead depend on the ABI tag note. For ldd, this means falling back to walking the notes in PT_NOTE segments to find the ABI tag note to determine if an ELF shared library without OSABI set in the header file is a FreeBSD shared library.

Reviewed by: kib
MFC after: 5 days
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D28342

Details

Provenance
jhbAuthored on Jan 29 2021, 6:53 PM
Reviewer
kib
Differential Revision
D28342: Fix ldd to work with more ELF files.
Parents
rGe25ee296c919: stand: lua: enhance lfs.dir() to speed up kernels_autodetect
Branches
Unknown
Tags
Unknown