Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jan 2013 17:34:48 +0530
From:      Shrikanth Kamath <shrikanth07@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   CTF wierdness when built for kernel modules
Message-ID:  <CAEOAkMW%2BiP5xniYMmaaY7KeiXB_K-rPR1nRxtFYVD-YC0O7o-w@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I am seeing some wierdness with the ctf sections built for the kernel
modules, (this is in a proprietary toolchain env) but FreeBSD 10.

To build the context,  the module.kld is built, ctfmerge is run on the
OBJS  and the consolidated .SUNW_ctf is appended in module.kld. When I
inspect the ctfdump op of module.kld I have this for e.g
        ...
        (func_one) returns: 22 args: (1984, 1739, 1986)
        (func_two) returns: 22 args: (2537, 22, 2534, 297)
        ...
Now when the .ko.debug is built,
<toolchain>-ld -m elf_i386 -Bshareable  -o module.ko.debug module.kld
and the ctfdump for the .SUNW_ctf again inspected (from
module.ko.debug) here is the observation...
        ...
        (func_two) returns: 22 args: (1984, 1739, 1986)
        (func_one) returns: 22 args: (2537, 22, 2534, 297)
        ...

What has happened is the position of func_one and func_two are
exchanged, and the arguments of func_two are shown against func_one
and vice-versa.
This is not the case for all functions though...some are correct
intact across this move from .kld to .ko

Does ld -Bshareable do anything to mess this up?

To mention when a I do a (gdb)ptype func_one or (gdb)ptype func_two
from both module.kld and module.ko.debug they are correct. It is only
in the CTF section that they are messed up...

--
Shrikanth R K



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEOAkMW%2BiP5xniYMmaaY7KeiXB_K-rPR1nRxtFYVD-YC0O7o-w>