From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 11 12:04:49 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E3A16F5E for ; Fri, 11 Jan 2013 12:04:49 +0000 (UTC) (envelope-from shrikanth07@gmail.com) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx1.freebsd.org (Postfix) with ESMTP id 79D377CB for ; Fri, 11 Jan 2013 12:04:49 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id eg20so1696475lab.30 for ; Fri, 11 Jan 2013 04:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ih9oi1dSsz1BS2E1NMFodQgctdWS7i39NNjCuVjf7jo=; b=ByACGO9aPMv01HGfhTGI/WYRVEecJL6qsIPD23SFZAzVm4pCDBNQ2vaEqyK2mSFmcs vmZBZNyOOF+f0uGZwX0CPtMxAF+WjI41VroyRi+37CTVCfogueYIfyPoxjCwH2KYWsoT fu5++2iwpPh/H2nCkqQbPjdhWe/W/6O+V6P+0OAYS4imDYoJMfbxWemc+B3Zef39BZdR zo2EqBF9Eux6Uy8pGjzGgGTA/VEL0WyFtFZ8+ngLjEczbvAJHuShIXNJnghOLku4p2jp mpP+1Obm4igY8zQicNeZmtB/QSPtn5aqnaRgcreg8XVZCCB+68hqzk6Tr7psdueZVQJf FqdA== MIME-Version: 1.0 Received: by 10.112.101.135 with SMTP id fg7mr30930986lbb.87.1357905888164; Fri, 11 Jan 2013 04:04:48 -0800 (PST) Received: by 10.112.139.71 with HTTP; Fri, 11 Jan 2013 04:04:48 -0800 (PST) Date: Fri, 11 Jan 2013 17:34:48 +0530 Message-ID: Subject: CTF wierdness when built for kernel modules From: Shrikanth Kamath To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 12:04:49 -0000 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, -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