From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2111 invoked by alias); 7 Jan 2010 11:02:23 -0000 Received: (qmail 1993 invoked by uid 22791); 7 Jan 2010 11:02:21 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jan 2010 11:02:16 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 74FB7CB021E; Thu, 7 Jan 2010 12:02:14 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HKBRina1KV14; Thu, 7 Jan 2010 12:02:14 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 5A98DCB021C; Thu, 7 Jan 2010 12:02:14 +0100 (CET) Subject: Re: Regression on prelinked-sepdebug-shlibs Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Tristan Gingold In-Reply-To: <20100106191608.GA28581@caradoc.them.org> Date: Thu, 07 Jan 2010 11:02:00 -0000 Cc: Jan Kratochvil , gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20091225200440.GA3747@host0.dyn.jankratochvil.net> <20100106180510.GA6748@host0.dyn.jankratochvil.net> <20100106191608.GA28581@caradoc.them.org> To: Daniel Jacobowitz X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00132.txt.bz2 On Jan 6, 2010, at 8:16 PM, Daniel Jacobowitz wrote: > On Wed, Jan 06, 2010 at 07:05:10PM +0100, Jan Kratochvil wrote: >> On Wed, 06 Jan 2010 17:38:55 +0100, Tristan Gingold wrote: >>> I think this is not correct: the separate debug file may have one secti= on at >>> zero while the main may not. In the above code, we do not consider wet= her >>> an offset is used. >>>=20 >>> I am not sure that this can happen with ELF however. >=20 > Sorry, I don't quite understand this. I am not sure that you can create a linux native executable with a section = whose vma is 0. I tried this: $ cat sep.c #include int zero (void) __attribute__((section("sec_zero"))); int zero (void) { return 0; } int main (void) { printf ("Zero=3D%d\n", zero ()); return 0; } $ gcc -c -g sep.c $ gcc -o sep sep.o -Wl,--section-start,sec_zero=3D0 But unfortunately linux refuses to execute that (I got a sigkill very very = early) so I can't play with that. (and I haven't investigated further in the kernel ;-) >> This has_section_at_zero feature is intended for embedded targets. I on= ly >> know has_section_at_zero can never happen for cases I am aware of. >>=20 >> IMHO embedded targets do not use the file-vs-memory offsets but not sure. >> Also the embedded targets probably do not use .linkonce/COMDAT - this is= why >> this has_section_at_zero differentiator could work. >=20 > An embedded program can use either of these things. The > linkonce/comdat issue is a constant problem, but this was the best > available heuristic. I agree that this heuristic make sense. However I don't think that the one= used for separate debug objfile is correct. I will submit a patch to discuss this point. Tristan.