public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Deepen Mantri" <Deepen.Mantri@kpitcummins.com>
To: <binutils@sources.redhat.com>
Cc: "Deepen Mantri" <Deepen.Mantri@kpitcummins.com>
Subject: No error for  Linker Section Overlapping
Date: Thu, 12 Apr 2007 13:50:00 -0000	[thread overview]
Message-ID: <B9D27836A814694B95A1C294F7145766582C44@sohm.kpit.com> (raw)



Hi,

Following is my observation regarding the modified LMA assignment done
in the 
binutils 2.17:

Now whenever the VMAs of sections overlap, it is assumed that 
these are overlay sections. Different LMAs are assigned to them instead
of 
reporting any section overlapping error as done in previous versions of 
binutils. 

Following are the relevant lines from my linker script.The size of
".data" 
section is 0x334 bytes which is observed from the map file. So VMAs of
".data"
and ".bss" sections are overlapping.

////////////////////////////////////////////////////////////////////////
/////

.data 0x00FFFA10 : AT (_mdata)
	{
		_data = .;
		*(.data)
		*(.data.*)
		_edata = .;
	}
.gcc_exc :
	{
		*(.gcc_exc)
	}
.bss 0x00FFFA20 :
	{
		_bss = .;
		*(.bss)
		*(COMMON)
		_ebss = .;
		_end = .;
	}
////////////////////////////////////////////////////////////////////////
//////

The VMA overlapping error should have been generated.
Instead, ".bss" section which is a nonloadable section, is assigned a
LMA 
under the same assumption that ".data" and ".bss" are overlay sections. 
(LMA of .bss section) = (LMA of .data section) + (size of .data
section).

Following lines from the generated map file exhibits the same.

////////////////////////////////////////////////////////////////////////
/////

.data           0x00fffa10      0x334     load address 0x000007ba
                0x00fffa10                      _data = .
   .                 .                             .
   .                 .                             . 
   .                 .                             .
   
 *(.data.*)     0x00fffd44                  _edata = .

.gcc_exc
 *(.gcc_exc)

.bss            0x00fffa20      0x6        load address 0x00000aee
                0x00fffa20                  _bss = .
  .                 .                             .
  .                 .                             . 
  .                 .                             .
                  
////////////////////////////////////////////////////////////////////////
/////

What is the benefit of assigning distinct LMAs to the non-overlay
sections 
having overlapped VMAs? 

Is there any way to generate an overlapping error for
non-overlay/non-loadable
sections (such as .bss section),if there VMAs get overlapped?


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, 2007.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

             reply	other threads:[~2007-04-12 13:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 13:50 Deepen Mantri [this message]
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

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=B9D27836A814694B95A1C294F7145766582C44@sohm.kpit.com \
    --to=deepen.mantri@kpitcummins.com \
    --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).