This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: NOLOAD problem with binutils 2.16.92
- From: "Ashutosh Yeole" <ashutoshy at KPITCummins dot com>
- To: <binutils at sourceware dot org>
- Cc: "Ben Elliston" <bje at au1 dot ibm dot com>
- Date: Mon, 31 Jul 2006 18:51:17 +0530
- Subject: RE: NOLOAD problem with binutils 2.16.92
Hi,
I have tried this problem using the latest snapshot of binutils dated
30th July 2006, however the same problem still exists. With this
snapshot, I tested for SH as well as H8 targets.
http://lists.gnu.org/archive/html/bug-binutils/2006-07/msg00041.html
(Link to the actual problem)
I have further investigated and developed a workaround patch which
solves the NOLOAD problem. In function ' elf_fake_sections' from
elf.c, "this_hdr" is populated. However, value for section header
(sh_type) is assigned only if "this_hdr->sh_type" is NULL. However,
I have found that, even for section with "NOLOAD" attribute, the
value of section header (this_hdr->sh_type) is 'SHT_PROGBITS' instead
of 'SHT_NOBITS' or 'SHT_NULL'. In case, it is SHT_NULL, then the
value for section type is found depending upon the other flags from
'asect->flags' (SEC_NEVER_LOAD).
Therefore, I have added a extra check to see if the 'SHT_PROGBITS' is
correct assignment in earlier processing or not.
No new regressions found with the following patch.
ChangeLog:
2006-07-31 Ashutosh Yeole <ashutoshy@kpitcummins.com>
* Binutils/bfd/elf.c (elf_fake_sections): Condition added for
section header type.
========================================================================
===
--- binutils-2.16.92/bfd/elf.c.orig 2006-03-16 17:50:15.000000000
+0530
+++ binutils-2.16.92/bfd/elf.c 2006-07-31 15:41:18.000000000 +0530
@@ -2695,7 +2695,7 @@ elf_fake_sections (bfd *abfd, asection *
/* If the section type is unspecified, we set it based on
asect->flags. */
- if (this_hdr->sh_type == SHT_NULL)
+ if ((this_hdr->sh_type == SHT_NULL) || (this_hdr->sh_type ==
SHT_PROGBITS))
{
if ((asect->flags & SEC_GROUP) != 0)
this_hdr->sh_type = SHT_GROUP;
========================================================================
===
However I am not very sure about the patch and I understand it may be
fixed somewhere else. I would like to know your comments on the same.
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Regards,
Ashutosh A Yeole
System Executive - SSG | KPIT Cummins Infosystems Ltd.| Ph: +91 020 2538
2358 Ext: 420
-----Original Message-----
From: Ben Elliston [mailto:bje@au1.ibm.com]
Sent: Friday, July 28, 2006 1:04 PM
To: Ashutosh Yeole
Cc: binutils@sourceware.org
Subject: Re: NOLOAD problem with binutils 2.16.92
> I had posted a problem related to binutils 2.16.92
>
> Please refer to the following link for the posted problem,
> http://sourceware.org/ml/binutils/2006-07/msg00225.html
> After further investigation, I found that this problem also exists for
> ARM and m32r targets also.
Before we go much further, have you tested with CVS binutils?
Cheers, Ben