From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11310 invoked by alias); 8 Oct 2004 06:29:32 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 11302 invoked from network); 8 Oct 2004 06:29:31 -0000 Received: from unknown (HELO gizmo03bw.bigpond.com) (144.140.70.13) by sourceware.org with SMTP; 8 Oct 2004 06:29:31 -0000 Received: (qmail 7056 invoked from network); 8 Oct 2004 06:29:29 -0000 Received: from unknown (HELO bwmam14.bigpond.com) (144.135.24.109) by gizmo03bw.bigpond.com with SMTP; 8 Oct 2004 06:29:29 -0000 Received: from cpe-144-136-221-26.sa.bigpond.net.au ([144.136.221.26]) by bwmam14.bigpond.com(MAM REL_3_4_2a 207/83947840) with SMTP id 83947840; Fri, 08 Oct 2004 16:29:29 +1000 Received: by bubble.modra.org (Postfix, from userid 500) id 28BEC12C388; Fri, 8 Oct 2004 15:59:29 +0930 Date: Fri, 08 Oct 2004 06:29:00 -0000 From: Alan Modra To: Jan Beulich , binutils@sources.redhat.com Subject: Re: gas rearranging elf file symbols Message-ID: <20041008062929.GN12632@bubble.modra.org> Mail-Followup-To: Jan Beulich , binutils@sources.redhat.com References: <20041008055319.GM12632@bubble.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041008055319.GM12632@bubble.modra.org> User-Agent: Mutt/1.4i X-SW-Source: 2004-10/txt/msg00107.txt.bz2 On Fri, Oct 08, 2004 at 03:23:19PM +0930, Alan Modra wrote: > the correct file. You can't do better for globals of course, since > global symbols are placed after local symbols, losing any association > you might infer from the symbol ordering. Actually, you can't do much about local symbols either. The ELF gABI says: STT_FILE Conventionally, the symbol's name gives the name of the source file associated with the object file. A file symbol has STB_LOCAL binding, its section index is SHN_ABS, and it precedes the other STB_LOCAL symbols for the file, if it is present. >From that wording you could also infer that there should only be one file symbol, that of the main source file. -- Alan Modra IBM OzLabs - Linux Technology Centre