Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263596AbUFYTjP (ORCPT ); Fri, 25 Jun 2004 15:39:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265354AbUFYTjP (ORCPT ); Fri, 25 Jun 2004 15:39:15 -0400 Received: from digitalimplant.org ([64.62.235.95]:12188 "HELO digitalimplant.org") by vger.kernel.org with SMTP id S263596AbUFYTjM (ORCPT ); Fri, 25 Jun 2004 15:39:12 -0400 Date: Fri, 25 Jun 2004 12:39:04 -0700 (PDT) From: Patrick Mochel X-X-Sender: mochel@monsoon.he.net To: "Richard B. Johnson" cc: Daniel Jacobowitz , Pavel Machek , Andrew Morton , kernel list Subject: Re: swsusp.S: meaningfull assembly labels In-Reply-To: Message-ID: References: <20040625115936.GA2849@elf.ucw.cz> <20040625151858.GA27013@nevyn.them.org> <20040625184817.GA3939@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1857 Lines: 55 > > drow@nevyn:~% cat a.s > > BUF = 0x1 > > code: > > mov %eax, 0 > > drow@nevyn:~% as -o a.o a.s > > drow@nevyn:~% as -o b.o a.s > > drow@nevyn:~% ld -o a a.o b.o > > ld: warning: cannot find entry symbol _start; defaulting to 0000000008048074 > > drow@nevyn:~% nm a.o > > 00000001 a BUF > > 00000000 t code > > drow@nevyn:~% nm a > > 00000001 a BUF > > 00000001 a BUF > > 08049084 A __bss_start > > 08049084 A _edata > > 08049084 A _end > > 08048074 t code > > 0804807c t code > > > > LD won't even warn about duplicate absolute symbols unless they have > > different values. > > > > But they ARE different values. They will probably always be different > values, and they end up with the same name, that `ld` sees and complains. No, it doesn't complain, that's the point. According to nm(1): For each symbol, nm shows: The symbol value, in the radix selected by options (see below), or hexadecimal by default. The symbol type. At least the following types are used; others are, as well, depending on the object file format. If lowercase, the symbol is local; if uppercase, the symbol is global (external). Symbols in a source file that are static are tagged with a 't' as well. Read System.map for more proof of this. The patch is fine, especially since I think it's based on something I've posted in the past. :) The one thing I'd always done differently, though, was to prefix the labels with '.', since I thought that was what kept it local. But, after I RTFM'd, I find that's not even necessary. Pat - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/