From owner-svn-src-head@FreeBSD.ORG Thu Mar 7 22:29:38 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 003204DC; Thu, 7 Mar 2013 22:29:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8DFD681B; Thu, 7 Mar 2013 22:29:36 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA23343; Fri, 08 Mar 2013 00:29:28 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UDjJY-000AsI-1j; Fri, 08 Mar 2013 00:29:28 +0200 Message-ID: <513914C4.4010001@FreeBSD.org> Date: Fri, 08 Mar 2013 00:29:24 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130220 Thunderbird/17.0.3 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r247960 - head/cddl/contrib/opensolaris/tools/ctf/cvt References: <201303072216.r27MGZ1b031061@svn.freebsd.org> In-Reply-To: <201303072216.r27MGZ1b031061@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 22:29:38 -0000 on 08/03/2013 00:16 Dimitry Andric said the following: > Author: dim > Date: Thu Mar 7 22:16:35 2013 > New Revision: 247960 > URL: http://svnweb.freebsd.org/changeset/base/247960 > > Log: > Make ctfconvert work correctly on clang-compiled object files. Clang > puts the full original source filename in the STT_FILE entry of the ELF > symbol table, while gcc saves only the basename. > > Since the DWARF DW_AT_name attribute contains the full source filename, > both for clang and gcc, ctfconvert takes just the basename of it, for > matching with the STT_FILE entry. So when attempting to match with such > an entry, use its basename, if necessary. I was not really kidding when I said that this change, as is, is a nop: > Reported by: avg > MFC after: 1 week > > Modified: > head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c > ============================================================================== > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 22:05:27 2013 (r247959) > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/output.c Thu Mar 7 22:16:35 2013 (r247960) > @@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, > > for (i = 0; i < nent; i++) { > GElf_Sym sym; > + char *bname; > iidesc_t **tolist; > GElf_Sym ssym; > iidesc_match_t smatch; > @@ -377,6 +378,8 @@ sort_iidescs(Elf *elf, const char *file, > > switch (GELF_ST_TYPE(sym.st_info)) { > case STT_FILE: > + bname = strrchr(match.iim_name, '/'); > + bname = bname == NULL ? match.iim_name : bname + 1; It would probably make sense to make use of bname after going to through all the trouble of calculating it: > match.iim_file = match.iim_name; Should be match.iim_file = bname ? Surprised that clang hasn't warned you about this one :-) > continue; > case STT_OBJECT: > -- Andriy Gapon