This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PPC ld test failure
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 3 Apr 2002 17:22:45 +0930
- Subject: Re: PPC ld test failure
- References: <hobsd2e2sx.fsf@gee.suse.de>
On Tue, Apr 02, 2002 at 01:51:42PM +0200, Andreas Jaeger wrote:
>
> The vers14 test from ld fails for me on powerpc with HJ's latest
> binutils release with:
> /usr/src/packages/BUILD/binutils-2.12.90.0.3/build-dir/ld/../binutils/strip-new tmpdir/vers14.so
> BFD: tmpdir/stJdPpsP: warning: allocated section `.data' not in segment
>
> Any ideas?
Broken by
2002-03-23 Alan Modra <amodra@bigpond.net.au>
* elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
section file offset for !SEC_LOAD sections.
It's not that the above patch is wrong, but rather that the test for
whether a section is included in a segment:
if (phdr->p_type == PT_LOAD
&& (bfd_vma) hdr->sh_offset >= phdr->p_offset
&& (hdr->sh_offset + hdr->sh_size
<= phdr->p_offset + phdr->p_memsz)
&& ((flags & SEC_LOAD) == 0
|| (phdr->p_offset + phdr->p_filesz
>= hdr->sh_offset + hdr->sh_size)))
is broken.
(gdb) p phdr[0]
$1 = {p_type = 1, p_flags = 5, p_offset = 0, p_vaddr = 0, p_paddr = 0,
p_filesz = 1848, p_memsz = 1848, p_align = 65536}
(gdb) p phdr[1]
$2 = {p_type = 1, p_flags = 6, p_offset = 1848, p_vaddr = 67384,
p_paddr = 67384, p_filesz = 168, p_memsz = 168, p_align = 65536}
(gdb) p *hdr
$3 = {sh_name = 108, sh_type = 1, sh_flags = 3, sh_addr = 67384, sh_size = 0,
sh_entsize = 0, sh_link = 0, sh_info = 0, sh_offset = 1848,
sh_addralign = 1, bfd_section = 0x0, contents = 0x0}
This hdr ought to be part of the second segment, but we decide that it's
part of the first. I think we need a test of hdr->sh_addr against
phdr->p_paddr.
--
Alan Modra
IBM OzLabs - Linux Technology Centre