This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] bfd/: bfd_elf_bfd_from_remote_memory 32bit &= 0xffffffff
- From: Andreas Schwab <schwab at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Thu, 11 Feb 2010 13:13:43 +0100
- Subject: Re: [patch] bfd/: bfd_elf_bfd_from_remote_memory 32bit &= 0xffffffff
- References: <20100211115730.GA7358@host0.dyn.jankratochvil.net>
Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> --- a/bfd/elfcode.h
> +++ b/bfd/elfcode.h
> @@ -1745,6 +1745,8 @@ NAME(_bfd_elf,bfd_from_remote_memory)
> if (!loadbase_set && (i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0)
> {
> loadbase = ehdr_vma - (i_phdrs[i].p_vaddr & -i_phdrs[i].p_align);
> + if (ELFCLASS == ELFCLASS32)
> + loadbase &= 0xffffffff;
Some targets use signed addresses.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."