This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: loadbase alignment - ld.so/prelink/kernel or bfd_elf_bfd_from_remote_memory() bug?


On Wed, Aug 15, 2007 at 03:56:10PM +0200, Jan Kratochvil wrote:
> bfd_elf_bfd_from_remote_memory() would almost work for general ELF files but it
> fails (I have no simple testcase) now due to the ELF `Base address' alignment.
> BFD uses `& -i_phdrs[i].p_align' for the VMA addresses but the real mapping
> is only PAGE_SIZE aligned (illustrated in the `BEFORE' dumps below).
> 
> For x86_64:
> 
> * bfd_elf_bfd_from_remote_memory() expects `loadbase' is P_ALIGN aligned.
> 
>   * GCC on x86_64 produces P_ALIGN 0x200000 == 2MB.

If bfd_elf_bfd_from_remote_memory() doesn't handle it, then it should be
fixed.  The current ld.so/prelink/kernel behavior is desirable.

	Jakub


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