From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31571 invoked by alias); 14 Nov 2009 15:47:34 -0000 Received: (qmail 31560 invoked by uid 22791); 14 Nov 2009 15:47:33 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Nov 2009 15:46:29 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id A9B0B10E94; Sat, 14 Nov 2009 15:46:27 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 58D5710595; Sat, 14 Nov 2009 15:46:27 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1N9KpW-0004WU-2M; Sat, 14 Nov 2009 10:46:26 -0500 Date: Sat, 14 Nov 2009 15:47:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: RFC: Strip the ISA bit when printing symbol offsets Message-ID: <20091114154626.GA17114@caradoc.them.org> Mail-Followup-To: Eli Zaretskii , gdb-patches@sourceware.org References: <20091113212716.GA28795@caradoc.them.org> <834ooxo3sd.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <834ooxo3sd.fsf@gnu.org> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2009-11/txt/msg00328.txt.bz2 On Sat, Nov 14, 2009 at 11:26:42AM +0200, Eli Zaretskii wrote: > Isn't it true that an address of a function should always be aligned, > so that its LSB is always zero? If so, I don't think we need to pass > the architecture pointer to build_address_symbolic, we could just > always reset the LSB. WDYT? No, that's not true. On a typical RISC architecture instructions are more than one byte and require alignment, but on x86_64: drow@caradoc:~% cat f.c int a() { return 0; } int b() { return 2; } drow@caradoc:~% gcc -Os -c f.c drow@caradoc:~% objdump -dr f.o f.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 : 0: 31 c0 xor %eax,%eax 2: c3 retq 0000000000000003 : 3: b8 02 00 00 00 mov $0x2,%eax 8: c3 retq -- Daniel Jacobowitz CodeSourcery