[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#649038: elfutils FTBFS on kfreebsd



On Sun, 2013-11-10 at 00:45 +0100, Robert Millan wrote:
> ELFOSABI_FREEBSD indicates this
> binary has been built to run on kFreeBSD and uses its kernel ABI.
> 
> If a binary is set to ELFOSABI_LINUX, then the kernel will enable Linux
> emulation mode, i.e. Linux syscall interface.

Aha. Interesting. Just curious. On Debain GNU/FreeBSD wouldn't the
emulation mode be more natural?

> Kernel modules are also built as ELF files, but AFAIK their e_ident is
> not checked for.
> 
> >>     - If it is the correct OS ABI then what would an elflint program
> >>       need to know about it to make sure all its requirements are met?
> 
> Nothing as far as ELF compliance is concerned. This tag is ment to be
> consumed by the kernel ELF loader only.

For elfutils elflint it also matters for things like STB_GNU_UNIQUE and
STT_GNU_IFUNC. Does ELFOSABI_FREEBSD indicate the binaray can or cannot
contain such symbol types or bindings? elflint assumes those only occur
with ELFOSABI_LINUX currently.

> >>   - The other failures look like issues with the /proc interface
> >>     on the install. Does the /proc interface follow the Linux kernel
> >>     /proc interface that some of the tests rely on?
> 
> Yes. But as there's no standard covering Linux-style /proc, it can't
> ever be 100% complete. FreeBSD developers provide an emulated
> "linprocfs" for compatibility purposes and try to keep up, but depending
> on what you do it might not work.
> 
> Also, this is only provided on GNU/kFreeBSD. FreeBSD systems either use
> the native FreeBSD-style /proc or none at all. If you want to support
> FreeBSD as well, it's better if you use sysctls or whatever you need for
> what you're testing.

This is mainly for the libdwl dwfl_linux_* group of
functions. /proc/PID/maps, /proc/PID/exe, /proc/PID/mem, /proc/TID/status and /proc/PID/auvx are used to inspect user space binaries with libdwfl. And /proc/kallsyms and /proc/modules are used to inspect kernel modules with libdwfl. See libdwfl/linux-proc-maps.c (backend for dwfl_linux_proc_report) and libdwfl/linux-kernel-modules.c (backend for dwfl_linux_kernel_report_kernel and dwfl_linux_kernel_report_modules). Someone might want to provide backends for kfreebsd if the corresponding libdwfl dwfl_linux_* functionality is wanted there. The kernel parts probably won't easily work, the user space parts probably will assuming the /proc interface is linprocfs style and sufficiently compatible.

Cheers,

Mark


Reply to: