public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: "DeRosa, Anthony" <Anthony.DeRosa@edocorp.com>
Cc: binutils@sourceware.org
Subject: Re: LMA XXX Overlaps Previous Sections When Using PHDRS
Date: Mon, 24 Dec 2007 17:21:00 -0000	[thread overview]
Message-ID: <476FEA82.1070501@redhat.com> (raw)
In-Reply-To: <3517CACAE247DD498B74D4B65A379E95270856@corpcboemb01.edocorp.com>

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

Hi Anthony,

> /opt/cross-tools/binutils-2.17-gcc-4.1.1-newlib-1.14.0/lib/gcc/i686-elf/
> 4.1.1/../../../../i686-elf/bin/ld: test.elf: section .section_0 lma
> 0x1000 overlaps previous sections

This is a bogus error message due to a spurious check in the linker.  Please 
try the attached patch and let me know if you have any problems.

Cheers
   Nick

bfd/ChangeLog

2007-12-24  Nick Clifton  <nickc@redhat.com>

	* elf.c (assign_file_positions_for_load_sections): Do not complain
	when then LMA is lower than the VMA.


[-- Attachment #2: elf.c.patch --]
[-- Type: text/x-patch, Size: 1111 bytes --]

Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.426
diff -c -3 -p -r1.426 elf.c
*** bfd/elf.c	11 Dec 2007 13:13:59 -0000	1.426
--- bfd/elf.c	24 Dec 2007 17:18:50 -0000
*************** assign_file_positions_for_load_sections 
*** 4339,4357 ****
  		      && ((this_hdr->sh_flags & SHF_TLS) == 0
  			  || p->p_type == PT_TLS)))
  		{
! 		  if (adjust < 0)
  		    {
! 		      (*_bfd_error_handler)
! 			(_("%B: section %A lma 0x%lx overlaps previous sections"),
! 			 abfd, sec, (unsigned long) sec->lma);
! 		      adjust = 0;
! 		    }
! 		  p->p_memsz += adjust;
  
! 		  if (this_hdr->sh_type != SHT_NOBITS)
! 		    {
! 		      off += adjust;
! 		      p->p_filesz += adjust;
  		    }
  		}
  	    }
--- 4339,4353 ----
  		      && ((this_hdr->sh_flags & SHF_TLS) == 0
  			  || p->p_type == PT_TLS)))
  		{
! 		  if (adjust > 0)
  		    {
! 		      p->p_memsz += adjust;
  
! 		      if (this_hdr->sh_type != SHT_NOBITS)
! 			{
! 			  off += adjust;
! 			  p->p_filesz += adjust;
! 			}
  		    }
  		}
  	    }

  reply	other threads:[~2007-12-24 17:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19 22:19 DeRosa, Anthony
2007-12-24 17:21 ` Nick Clifton [this message]
2007-12-25 23:09   ` Alan Modra
2007-12-26 19:02     ` Nick Clifton
2007-12-26 21:40       ` Alan Modra
  -- strict thread matches above, loose matches on Subject: below --
2007-12-19 22:15 DeRosa, Anthony

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=476FEA82.1070501@redhat.com \
    --to=nickc@redhat.com \
    --cc=Anthony.DeRosa@edocorp.com \
    --cc=binutils@sourceware.org \
    /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).