]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kldxref: Simplify handling of ELF object files
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 22 Dec 2023 15:49:18 +0000 (07:49 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 18 Jan 2024 21:31:32 +0000 (13:31 -0800)
commit21dec6c48f089ce55ec32fa04a8962ea52b3d9ef
tree2195573e8556f2ff68c95525492bf9aaa0e376f1
parentea717376822edc921a66f8b149ba3b6ca7536e8a
kldxref: Simplify handling of ELF object files

Unlike the backend for ELF DSOs, the object file backend allocated an
aligned chunk of memory and read all of the in-memory sections from
the file into this memory even though most of the file contents were
never used.  Instead, just track a set of virtual addresses (based at
0) that each loaded section would be loaded at and only read the
necessary bits from the backing file when needed.

Reviewed by: imp
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D43126

(cherry picked from commit 0d557cdf6f0e94e909acea065f3de2a28437ae74)
usr.sbin/kldxref/ef_obj.c