This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]