public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Ashutosh Yeole" <ashutoshy@KPITCummins.com>
To: <binutils@sourceware.org>
Subject: NOLOAD problem with binutils 2.16.92
Date: Tue, 18 Jul 2006 12:54:00 -0000	[thread overview]
Message-ID: <4A1BE23A7B777442B60F4B4916AE0F130CEE5AD4@sohm.kpit.com> (raw)


Hi,

I am facing a problem in binutils 2.16.92.

Please refer to the code and the linker script below.

CODE:
-----

char ldTest __attribute__ ((section("TEST")));

int main(void)
{
	ldTest = 5;
}

LINKER SCRIPT:
--------------
	.bss :
	{
		_bss = .;
		*(.bss)
		*(COMMON)
		_ebss = .;
		_end = .;
	}
	.stack 0x00083800 :
	{
		_stack = .;
	}
	TEST 0x00FFEC00 (NOLOAD) :
	{
		*(TEST)
	}


In the Linker script the user defined section "TEST" is assigned as
NOLOAD. Here it is expected that "TEST" section to behave same as ".bss"
section.
When above code is linked using the binutils 2.16.92, "TEST" section is
assigned PROGBITS type whereas ".bss" section is assigned NOBITS type.

But when the same code and linker script are linked using binutils
2.16.1 then the "TEST" and ".bss" sections are assigned as NOBITS type.

Below are the results observed:

Section Headers:
[Nr] Name   Type         Addr     Off    Size   ES Flg Lk Inf Al
	.
	.
[ 8] .bss   NOBITS       000827c4 00203c 00002a 00  WA  0   0  4
[ 9] TEST   PROGBITS     00ffec00 00203c 000001 00  WA  0   0  1
	.
	.
	.

TEST section is assigned PROGBITS instead of NOBITS when linked using ld
(binutils 2.16.92).

Section Headers:
[Nr] Name   Type         Addr     Off    Size   ES Flg Lk Inf Al
	.
	.
[ 9] .bss   NOBITS       00082740 001de6 000046 00  WA  0   0  4
[10] TEST   NOBITS       00ffec00 001de6 000001 00  WA  0   0  1
	.
	.
	.
TEST section is assigned NOBITS when linked using ld (binutils 2.16.1).

This problem exists on both SH and H8/300 targets.

Please let me know why this is happening and any solution to fix this
problem.

The same bug has been reported on,
http://lists.gnu.org/archive/html/bug-binutils/2006-07/msg00041.html
however we did not receive any reply to the same. Can anyone help us to
resolve this issue?

Regards,
Ashutosh Yeole
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 June 1, 2006.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	

             reply	other threads:[~2006-07-18 12:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18 12:54 Ashutosh Yeole [this message]
2006-07-26 10:01 Ashutosh Yeole
2006-07-26 20:11 ` Ramana Radhakrishnan
2006-07-28  7:32 ` Ben Elliston
2006-07-31 13:21   ` Ashutosh Yeole
2006-07-31 14:54     ` H. J. Lu
2006-07-31 20:03     ` H. J. Lu
2006-07-31 23:45       ` Alan Modra
2006-08-01 17:43         ` H. J. Lu

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=4A1BE23A7B777442B60F4B4916AE0F130CEE5AD4@sohm.kpit.com \
    --to=ashutoshy@kpitcummins.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).