From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 3 15:45:37 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 C09D91A1; Sun, 3 Mar 2013 15:45:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 84E7FCF2; Sun, 3 Mar 2013 15:45:37 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a] (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0AD4B5C43; Sun, 3 Mar 2013 16:45:29 +0100 (CET) Message-ID: <51337018.30000@FreeBSD.org> Date: Sun, 03 Mar 2013 16:45:28 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20130117 Thunderbird/19.0 MIME-Version: 1.0 To: Andriy Gapon , freebsd-hackers@FreeBSD.org Subject: Re: clang generated code sometimes confuses fbt References: <5132387E.8010808@FreeBSD.org> <51323C62.4040506@FreeBSD.org> <51325FB3.7080300@FreeBSD.org> In-Reply-To: <51325FB3.7080300@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Sun, 03 Mar 2013 15:45:37 -0000 On 2013-03-02 21:23, Dimitry Andric wrote: > On 2013-03-02 18:52, Andriy Gapon wrote: >> on 02/03/2013 19:35 Andriy Gapon said the following: >>> Now, I am not quite sure why ctfconvert skips bpobj_iterate_impl in the >>> clang-generated code. Seems like some sort of a bug in ctfconvert. >> >> It seems that gcc and clang put different names for symbol of type FILE: >> clang: >> readelf -a -W /usr/obj/usr/src/sys/TRANT/bpobj.o| fgrep -w FILE >> 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS >> /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c >> >> gcc: >> readelf -a -W /usr/obj/usr/src/sys/ODYSSEY/bpobj.o| fgrep -w FILE >> 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS bpobj.c >> >> ctfconvert seems to compare this value with "bpobj.c" and so in the clang case >> it doesn't recognize the static symbols. >> >> Does my analysis seem reasonable? > > Have you verified that ctfconvert does the right thing, if you modify > the FILE symbol to have just the filename? Debug log of ctfconvert operating on a gcc-compiled bpobj.o: http://www.andric.com/freebsd/ctfconvert-bpobj-gcc.log The same, but on a clang-compiled bpobj.o: http://www.andric.com/freebsd/ctfconvert-bpobj-clang.log This latter log does not change at all, if you change the FILE symbol to just "bpobj.c". So there seems to something else in (probably) the debug information that confuses ctfconvert.