]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix ldd to work with more ELF files.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 29 Jan 2021 18:53:50 +0000 (10:53 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 9 Feb 2021 17:32:31 +0000 (09:32 -0800)
commit1f0bc379eb71af6d1cbc857a5b1316a115fbc649
treef8bd5ebfdf8b0fa549341339d65f53ee41ed3ef1
parent07eed38ae2de9b0194c1beef797c05cf57cdcd97
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.

Approved by: re (gjb)

(cherry picked from commit 9d4104b214963bb3371ada05cae8006940121634)
(cherry picked from commit fa3b2ad265d311191c1c8337bf3aa356f28480cb)
usr.bin/ldd/Makefile
usr.bin/ldd/ldd.c