public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: binutils@sources.redhat.com, Roland McGrath <roland@redhat.com>
Subject: Re: [patch] Fix bfd_elf_bfd_from_remote_memory() loadbase
Date: Sat, 11 Aug 2007 00:22:00 -0000	[thread overview]
Message-ID: <20070811002217.GA27982@bubble.grove.modra.org> (raw)
In-Reply-To: <20070810151546.GA29386@host0.dyn.jankratochvil.net>

On Fri, Aug 10, 2007 at 05:15:46PM +0200, Jan Kratochvil wrote:
> I believe a simple rule "just the first PT_LOAD segment" implemented in my
> patch should be enough.

No.  Please fix this properly as per the ELF gABI.

"An executable or shared object file's base address (on platforms that
support the concept) is calculated during execution from three values:
the virtual memory load address, the maximum page size, and the lowest
virtual address of a program's loadable segment. To compute the base
address, one determines the memory address associated with the lowest
p_vaddr value for a PT_LOAD segment. This address is truncated to the
nearest multiple of the maximum page size. The corresponding p_vaddr
value itself is also truncated to the nearest multiple of the maximum
page size. The base address is the difference between the truncated
memory address and the truncated p_vaddr value."

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2007-08-11  0:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 15:16 Jan Kratochvil
2007-08-11  0:22 ` Alan Modra [this message]
2007-08-13  1:16   ` Roland McGrath
2007-08-13  3:57     ` Alan Modra
2007-08-13  4:15       ` Roland McGrath
2007-08-13 21:28     ` Jan Kratochvil
2007-08-14  2:03       ` Alan Modra
2007-08-15 13:56     ` loadbase alignment - ld.so/prelink/kernel or bfd_elf_bfd_from_remote_memory() bug? Jan Kratochvil
2007-08-15 14:03       ` H.J. Lu
2007-08-15 14:41         ` Jan Kratochvil
2007-08-15 14:45           ` H.J. Lu
2007-08-15 14:46             ` H.J. Lu
2007-08-15 15:08       ` Jakub Jelinek
2007-08-15 16:00         ` H.J. Lu
2007-08-21  0:32           ` [patch] bfd_elf_bfd_from_remote_memory() workaround for the ELF misalignment [Re: loadbase alignment - ld.so/prelink/kernel or bfd_elf_bfd_from_remote_memory() bug?] Jan Kratochvil
2007-08-21 12:56             ` Roland McGrath
2007-08-21 15:14             ` H.J. Lu
2007-08-21 20:44               ` Daniel Jacobowitz
2007-08-21 22:22                 ` Roland McGrath
2007-08-22  0:11                   ` Daniel Jacobowitz
2007-08-22  1:07                     ` [patch] bfd_elf_bfd_from_remote_memory() workaround for the ELF misalignment Jan Kratochvil
2007-08-24 13:00                       ` Jan Kratochvil
2007-08-23  2:02                     ` [patch] bfd_elf_bfd_from_remote_memory() workaround for the ELF misalignment [Re: loadbase alignment - ld.so/prelink/kernel or bfd_elf_bfd_from_remote_memory() bug?] Roland McGrath

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=20070811002217.GA27982@bubble.grove.modra.org \
    --to=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=roland@redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).