Re: [patch] bfd/: bfd_elf_bfd_from_remote_memory 32bit &= 0xffffffff

Andreas Schwab
2010-02-11T12:13:52Z

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."