Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Mar 2013 12:50:02 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: clang generated code sometimes confuses fbt
Message-ID:  <51348A6A.3070606@FreeBSD.org>
In-Reply-To: <5133AC3B.5040504@FreeBSD.org>
References:  <5132387E.8010808@FreeBSD.org> <51323C62.4040506@FreeBSD.org> <51325FB3.7080300@FreeBSD.org> <51337018.30000@FreeBSD.org> <51337C27.7000105@FreeBSD.org> <5133AC3B.5040504@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060403060209040404050200
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 2013-03-03 21:02, Dimitry Andric wrote:
> On 2013-03-03 17:36, Andriy Gapon wrote:
>> on 03/03/2013 17:45 Dimitry Andric said the following:
...
> So to fix this inconsistency, we could either change dw_read() to use
> the full name instead of the basename, or change sort_iidescs() to use
> the basename instead of the full name.
>
> The only upstream I have been able to find, Illumos, had the same code
> as FreeBSD for both of these functions, so it is likely they never
> noticed it before...
>
> My preference would be to remove the basename() call from dw_read(), as
> in the attached diff.  That seems to fix the problem here; the diff of
> ctfdump output before and after becomes:

Actually, that way of fixing breaks it for gcc, so it should really be
fixed in sort_iidescs() instead.  See attached diff; I verified it works
for both gcc-compiled and clang-compiled objects.

--------------060403060209040404050200
Content-Type: text/x-diff;
 name="ctfconvert-output-1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="ctfconvert-output-1.diff"

Index: cddl/contrib/opensolaris/tools/ctf/cvt/output.c
===================================================================
--- cddl/contrib/opensolaris/tools/ctf/cvt/output.c	(revision 247448)
+++ cddl/contrib/opensolaris/tools/ctf/cvt/output.c	(working copy)
@@ -363,6 +363,7 @@ sort_iidescs(Elf *elf, const char *file, tdata_t *
 
 	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, tdata_t *
 
 		switch (GELF_ST_TYPE(sym.st_info)) {
 		case STT_FILE:
+			bname = strrchr(match.iim_name, '/');
+			bname = bname == NULL ? match.iim_name : bname + 1;
 			match.iim_file = match.iim_name;
 			continue;
 		case STT_OBJECT:

--------------060403060209040404050200--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51348A6A.3070606>