aboutsummaryrefslogtreecommitdiff
path: root/lib/libkldelf
Commit message (Collapse)AuthorAgeFilesLines
* libkldelf: add see_local parameter to elf_lookup_symbolKa Ho Ng2024-10-254-18/+25
| | | | | | | | This gives the function the ability to return only global symbols. Sponsored by: Juniper Networks, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47206
* libkldelf: use warnx instead of printfKa Ho Ng2024-10-181-6/+6
| | | | | | Sponsored by: Juniper Networks, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46893
* libkldelf: add elf_lookup_symbol functionKa Ho Ng2024-10-184-0/+21
| | | | | | | | | | The elf_lookup_symbol function looks up the symbol with a given symbol name. A pointer to the GElf_Sym of the symbol is returned if the symbol exists in the opened ELF file. Sponsored by: Juniper Networks, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46764
* libkldelf: add a private library for kernel/kld-related ELF parsingKa Ho Ng2024-10-1813-0/+2840
| | | | | | | | | | | | | | | | | | | | | | The libkldelf library was originally a part of kldxref(8). It exposed ELF parsing helpers specialized in parsing KLDs and the kernel executable. The library can be used to read metadata such as linker_set, mod_depend, mod_version and PNP match info, and raw data from the ELF. To promote the reuse of the facilities the ELF parsing code is separated from kldxref(8) into a new private library. For now, libkldelf's source files will be compiled into kldxref(8) directly if kldxref is built during bootstrapping phase. The reason is linking kldxref(8) against the libkldelf static library has an unwanted side effect which renders the linker sets inside the libkldelf implementation empty if the static library is not build by ld -r all the .o files into a single .o before producing the static library. Sponsored by: Juniper Networks, Inc. Reviewed by: markj Suggested by: jrtc27, markj Differential Revision: https://reviews.freebsd.org/D46719
* Revert "libkldelf: add a private library for kernel/kld-related ELF parsing"Ka Ho Ng2024-10-0813-2840/+0
| | | | This reverts commit 0a2cfd653e86ac41c4e6e32a449d133c0ee6d677.
* Revert "libkldelf: add elf_lookup_symbol function"Ka Ho Ng2024-10-084-21/+0
| | | | This reverts commit 2c7d84795628cb9c7a266718b99b6bca68e0a135.
* Revert "libkldelf: use warnx instead of printf"Ka Ho Ng2024-10-081-6/+6
| | | | This reverts commit 550ee2d03c5b88bc5d74b257ffcb3ed2c06a60bb.
* libkldelf: use warnx instead of printfKa Ho Ng2024-10-081-6/+6
| | | | | | Sponsored by: Juniper Networks, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46893
* libkldelf: add elf_lookup_symbol functionKa Ho Ng2024-10-084-0/+21
| | | | | | | | | | The elf_lookup_symbol function looks up the symbol with a given symbol name. A pointer to the GElf_Sym of the symbol is returned if the symbol exists in the opened ELF file. Sponsored by: Juniper Networks, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46764
* libkldelf: add a private library for kernel/kld-related ELF parsingKa Ho Ng2024-10-0813-0/+2840
The libkldelf library was originally a part of kldxref(8). It exposed ELF parsing helpers specialized in parsing KLDs and the kernel executable. The library can be used to read metadata such as linker_set, mod_depend, mod_version and PNP match info, and raw data from the ELF. To promote the reuse of the facilities the ELF parsing code is separated from kldxref(8) into a new private library. kldxref(8) is modified to link against the libkldelf library. Sponsored by: Juniper Networks, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46719