Page MenuHomeFreeBSD

loader: fix elf lookup_symbol type filtering

Authored by kevans on Oct 13 2022, 2:25 AM.
Referenced Files
Unknown Object (File)
Jan 3 2024, 8:56 PM
Unknown Object (File)
Jan 3 2024, 8:56 PM
Unknown Object (File)
Jan 3 2024, 8:51 PM
Unknown Object (File)
Jan 3 2024, 8:39 PM
Unknown Object (File)
Jan 2 2024, 3:28 PM
Unknown Object (File)
Dec 20 2023, 4:17 AM
Unknown Object (File)
Dec 12 2023, 5:39 AM
Unknown Object (File)
Oct 24 2023, 4:21 AM



The existing logic doesn't seem to make much sense, as we won't filter
on the type if st_shndx != SHN_UNDEF. In practice, this breaks booting
12.3 kernels on newer loaders, as they do have a kernphys symbol of
the wrong type (NOTYPE, rather than OBJECT) -- we end up deriving the
wrong value for copy_staging.

It's unclear if this version makes any more sense, but it seems to match
what rtld's matched_symbol() does. Loader doesn't need to care about
STT_FUNC w/ UND shndx, because we won't encounter those; in kmods,
undefined (kernel) functions are NOTYPE.

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable