public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: Andreas Jaeger <aj@suse.de>
Cc: binutils@sources.redhat.com
Subject: Re: PPC ld test failure
Date: Tue, 02 Apr 2002 23:59:00 -0000	[thread overview]
Message-ID: <20020403075245.GF1042@bubble.sa.bigpond.net.au> (raw)
In-Reply-To: <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

  reply	other threads:[~2002-04-03  7:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-02  3:51 Andreas Jaeger
2002-04-02 23:59 ` Alan Modra [this message]
2002-04-03  5:25   ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020403075245.GF1042@bubble.sa.bigpond.net.au \
    --to=amodra@bigpond.net.au \
    --cc=aj@suse.de \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).