Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: Strip the ISA bit when printing symbol offsets
Date: Sat, 14 Nov 2009 15:47:00 -0000	[thread overview]
Message-ID: <20091114154626.GA17114@caradoc.them.org> (raw)
In-Reply-To: <834ooxo3sd.fsf@gnu.org>

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 <a>:
   0:   31 c0                   xor    %eax,%eax
   2:   c3                      retq

0000000000000003 <b>:
   3:   b8 02 00 00 00          mov    $0x2,%eax
   8:   c3                      retq

-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2009-11-14 15:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13 21:27 Daniel Jacobowitz
2009-11-13 22:25 ` Joel Brobecker
2009-12-28 21:12   ` Daniel Jacobowitz
2009-11-14  9:28 ` Eli Zaretskii
2009-11-14 15:47   ` Daniel Jacobowitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091114154626.GA17114@caradoc.them.org \
    --to=drow@false.org \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox