public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Deepen Mantri" <Deepen.Mantri@kpitcummins.com>
To: "Alan Modra" <amodra@bigpond.net.au>
Cc: <binutils@sources.redhat.com>
Subject: RE: No error for  Linker Section Overlapping
Date: Tue, 24 Apr 2007 10:59:00 -0000	[thread overview]
Message-ID: <B9D27836A814694B95A1C294F71457668BF15D@sohm.kpit.com> (raw)
In-Reply-To: <20070423153115.GD10537@bubble.grove.modra.org>


On Sat, 21st April 2007 at 10:31:18 +0930 Alan Modra wrote:

>> 1. Error prints the LMA addresses instead of VMA addresses
>>    when VMAs of the sections overlap. This might create 
>>    confusion.	
>  VMA == LMA except when using overlays or when assigning 
>  LMA in the linker script.  I don't think the error message
>  is worth changing.

Being precise in printing the source of error would help the
user in understanding and fixing the problem quickly, isn't it?

On Tue, 24th April 2007 at 01:01:15 +0930 Alan Modra wrote:

> Changing the lma to vma relationship will put .bss into a 
> different load segment. Usually you wouldn't want that to 
> happen, because it needlessly creates a new segment.

Considering the linker script in my preceeding reply, a new 
segment for .bss section is expected and is rightly created 
because of the following condition present in the 
"_bfd_elf_map_sections_to_segments" function.

//////////////////////////////////////////////////////////////
else if (last_hdr->lma - last_hdr->vma != hdr->lma - hdr->vma)
{
     /* If this section has a different relation between the
        virtual address and the load address, then we need a 
        new segment.  */
     new_segment = TRUE;
}
/////////////////////////////////////////////////////////////
The .bss section was assigned a new segment till binutils 2.16.92.
From binutils 2.17 onwards .bss section is not going in a new 
segment because it's LMA is following the .data section and thus
resulting in failure of the above condition.


> Please just add "AT(ADDR(.bss))" to your .bss output 
> section description.

Adding "AT(ADDR(.bss))" seems to be a workaround. I guess, it 
will be always better to fix the problem inside the linker 
itself. Please comment.

Only concern is that the additions done should not result in
unexpected failures in other parts of linker code which, as far as 
my understanding goes, is not happening.
If you foresee any fundamental change happening in the 
linker code due to my patch, could you please share it with me?


Regards,		
Deepen Mantri		

KPIT Cummins InfoSystems Ltd.		
Pune, India		

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	
Free download of GNU based tool-chains for Renesas' SH, H8, R8C,
M16C and M32C Series. The following site also offers free 
technical support to its users. Visit http://www.kpitgnutools.com
for details. Latest versions of KPIT GNU tools were released on 
February 6,07	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	

      reply	other threads:[~2007-04-24 10:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 13:50 Deepen Mantri
2007-04-14  1:42 ` Alan Modra
2007-04-17 13:17   ` Deepen Mantri
2007-04-18  4:10     ` Alan Modra
2007-04-19 17:05       ` Deepen Mantri
2007-04-21  5:01         ` Alan Modra
2007-04-23 15:08           ` Deepen Mantri
2007-04-23 15:32             ` Alan Modra
2007-04-24 10:59               ` Deepen Mantri [this message]

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=B9D27836A814694B95A1C294F71457668BF15D@sohm.kpit.com \
    --to=deepen.mantri@kpitcummins.com \
    --cc=amodra@bigpond.net.au \
    --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).