d281fece | 22-Dec-2023 |
John Baldwin <jhb@FreeBSD.org> |
kldxref: Appease a Coverity warning
While parsing .dynamic, nsym is set when parsing the symbol table from .dynsym. That parsing also sets ef->ef_symtab to a non-NULL value. The value of nsym isn't
kldxref: Appease a Coverity warning
While parsing .dynamic, nsym is set when parsing the symbol table from .dynsym. That parsing also sets ef->ef_symtab to a non-NULL value. The value of nsym isn't validated until after a check for ef->ef_symtab being NULL, so nsym always has a valid value when it is read. However, that chain of events is a bit much for static analysis to follow, so initialize nsym to 0 before parsing sections to quiet the warning.
Reported by: Coverity Scan CID: 1532339 Sponsored by: DARPA
show more ...
|
0d557cdf | 22-Dec-2023 |
John Baldwin <jhb@FreeBSD.org> |
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
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
show more ...
|
ed96fd7f | 22-Dec-2023 |
John Baldwin <jhb@FreeBSD.org> |
kldxref: Simplify elf_read_raw_data
Use pread as a valid offset is always passed now. Originally the DSO code read the .hash section in two separate requests and relied on the implicit offset for t
kldxref: Simplify elf_read_raw_data
Use pread as a valid offset is always passed now. Originally the DSO code read the .hash section in two separate requests and relied on the implicit offset for the second read, but now the hash table is fetched in a single call.
Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43125
show more ...
|
2a622f14 | 14-Dec-2023 |
Jessica Clarke <jrtc27@FreeBSD.org> |
kldxref: Reduce divergence between per-architecture files
Note that relbase is always 0 for DSOs so its omission for __KLD_SHARED architectures was not a bug in practice.
Whilst here, also parenthe
kldxref: Reduce divergence between per-architecture files
Note that relbase is always 0 for DSOs so its omission for __KLD_SHARED architectures was not a bug in practice.
Whilst here, also parenthesise the dest offset for where to avoid transiently creating an out-of-bounds pointer, which is UB (though even on CHERI architectures, where capability bounds compression can result in that creating invalid capabilities that will trap on dereference, optimisation will reassociate to the correct form in practice and thus work just fine).
show more ...
|
aaba1490 | 14-Dec-2023 |
Jessica Clarke <jrtc27@FreeBSD.org> |
kldxref: Implement aarch64 R_AARCH64_AB64 relocation
Doing nothing seems to be sufficient but is strange, inconsistent with other architectures, and not necessary when it's easy to support properly. |