[Bug binutils/2225] cisco IOS MIPS ELF causes coredump

2006-01-30 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2006-01-30 11:56 
---
This bug was fixed by Jakub Jelinek's patch of 2005-06-14, where amoungst other
changes to readelf.c he includes:

  (process_program_headers): Don't crash if string_table is NULL.

With this patch in place readelf does not crash with the given input file.


-- 
   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=2225

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Assembler unable to handle relative offsets in PIC code under cross-compiling env.

2006-01-30 Thread Ayonam Ray
Hi,

I'm trying to build a cross-compiling environment for AMD64 to run on x86
platforms using binutils-2.15.92.0.2.  I use the following command on my AMD64
machine to configure binutils:

CC="gcc -m32" ../configure --target=x86_64-redhat-linux \
--prefix=$NIRMAAN_BUILD_ENV/usr \
--program-suffix="-2.15" --enable-shared \
--enable-targets=i386-redhat-linux

Then I did a "make install".  Both the steps went through fine with no errors.  
However, the installed assembler when run with the following options:

--traditional-format -V -Qy

on a particular assembly file (will ship it on request) gives the following 
errors:

GNU assembler version 2.15 (x86_64-redhat-linux) using BFD version 2.15
t.s: Assembler messages:
t.s:4671: Error: invalid sections for operation on `.L1430' and `L0'
t.s:4670: Error: invalid sections for operation on `.L1430' and `L0'
t.s:4669: Error: invalid sections for operation on `.L1424' and `L0'


This assembly code was obtained using GCC 2.3.2 using the "-fPIC -m64" option.  
The problem vanishes when I compile without the -fPIC option but keep the 
"-m64" option.  I.e., non-PIC code work while PIC code doesn't.

The problem also vanishes when I reconfigure the binutils package and
reinstall it with CC="gcc -m64".  Essentially the 64-bit executable works 
while the 32-bit executable doesn't.

Is there a solution to this problem already?

Thanks in advance and regards
Ayonam



___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: objcopy --add-section doubt

2006-01-30 Thread Nick Clifton

Hi Kartikeyan,

Thanks for the test case.  Using it I was able to reproduce the problem.


so NULL is being returned as newsect->name is not NULL


Yes - this is the heart of the matter.  What is happening is that you 
are attempting to add a section that already exists.  The old (RH9) 
binutils silently allowed this, which was incorrect.  The current 
binutils sources does not allow the existing section to be re-added, but 
it does produce a very unhelpful warning message.


The attached patch (which I will be checking into the sources shortly) 
changes the warning to:


   can't add section '.skdata' - it already exists!

which I think is much better.


I AM NOT A EXPERT IN BINUTILS.


It's OK there is no need to shout.

If you want to achieve the old behaviour of RH9 then you can just amend 
your objcopy command line to include "--remove-section .skdata" before 
the "--add-section .skdata=a" switch.


Cheers
  Nick

binutils/ChangeLog
2006-01-30  Nick Clifton  <[EMAIL PROTECTED]>

* objcopy.c (copy_object): Catch the case where an attempt is made
to add a section that already exists and produce a more helpful
warning message.

Index: binutils/objcopy.c
===
RCS file: /cvs/src/src/binutils/objcopy.c,v
retrieving revision 1.93
diff -c -3 -p -r1.93 objcopy.c
*** binutils/objcopy.c	18 Jan 2006 11:01:09 -	1.93
--- binutils/objcopy.c	30 Jan 2006 12:58:45 -
*** copy_object (bfd *ibfd, bfd *obfd)
*** 1313,1325 
  	  if (pset != NULL && pset->set_flags)
  	flags = pset->flags | SEC_HAS_CONTENTS;
  
! 	  padd->section = bfd_make_section_with_flags (obfd, padd->name, flags);
! 	  if (padd->section == NULL)
  	{
! 	  non_fatal (_("can't create section `%s': %s"),
! 		   padd->name, bfd_errmsg (bfd_get_error ()));
  	  return FALSE;
  	}
  
  	  if (! bfd_set_section_size (obfd, padd->section, padd->size))
  	{
--- 1313,1335 
  	  if (pset != NULL && pset->set_flags)
  	flags = pset->flags | SEC_HAS_CONTENTS;
  
! 	  /* bfd_make_section_with_flags() does not return very helpful
! 	 error codes, so check for the most likely user error first.  */
! 	  if (bfd_get_section_by_name (obfd, padd->name))
  	{
! 	  non_fatal (_("can't add section '%s' - it already exists!"), padd->name);
  	  return FALSE;
  	}
+ 	  else
+ 	{
+ 	  padd->section = bfd_make_section_with_flags (obfd, padd->name, flags);
+ 	  if (padd->section == NULL)
+ 		{
+ 		  non_fatal (_("can't create section `%s': %s"),
+ 			 padd->name, bfd_errmsg (bfd_get_error ()));
+ 		  return FALSE;
+ 		}
+ 	}
  
  	  if (! bfd_set_section_size (obfd, padd->section, padd->size))
  	{
___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Building binutils-2.15.97 --enable-targets=all

2006-01-30 Thread Nick Clifton

Hi Muhammad,


While building binutils (binutils-2.15.97.tar.bz2) on Cygwin, as follows:

configure --enable-targets=all --enable-shared --with-gnu-as --with-gnu-ld
make



I got the following error:

obj-coff.o: In function `coff_frob_symbol':
/usr/src/binutils-2.15.97/gas/config/obj-coff.c:1145: undefined

reference to `_an_external_name'


This does not happen with the latest sources in the CVS repository, nor 
with the officially released 2.16 sources, so I do not really see this 
as a problem.


Cheers
  Nick


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Building binutils-2.15.97 --enable-targets=all

2006-01-30 Thread Daniel Jacobowitz
On Mon, Jan 30, 2006 at 03:54:10PM +0200, Muhammad Haggag wrote:
> On 1/30/06, Nick Clifton <[EMAIL PROTECTED]> wrote:
> > Hi Muhammad,
> >
> > > While building binutils (binutils-2.15.97.tar.bz2) on Cygwin, as follows:
> > >> configure --enable-targets=all --enable-shared --with-gnu-as 
> > >> --with-gnu-ld
> > >> make
> >
> > > I got the following error:
> > >> obj-coff.o: In function `coff_frob_symbol':
> > >> /usr/src/binutils-2.15.97/gas/config/obj-coff.c:1145: undefined
> > > reference to `_an_external_name'
> >
> > This does not happen with the latest sources in the CVS repository, nor
> > with the officially released 2.16 sources, so I do not really see this
> > as a problem.
> >
> Hmm...I downloaded 2.15.97 because it was the latest on
> ftp://sourceware.org/pub/binutils/snapshots - didn't know there was a
> more recent release.

binutils-060130.tar.bz2 is more recent; the things with 2.x.y version
numbers are prerelease snapshots, and the matching final releases are
available in the releases directory.

-- 
Daniel Jacobowitz
CodeSourcery


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Building binutils-2.15.97 --enable-targets=all

2006-01-30 Thread Muhammad Haggag
On 1/30/06, Nick Clifton <[EMAIL PROTECTED]> wrote:
> Hi Muhammad,
>
> > While building binutils (binutils-2.15.97.tar.bz2) on Cygwin, as follows:
> >> configure --enable-targets=all --enable-shared --with-gnu-as --with-gnu-ld
> >> make
>
> > I got the following error:
> >> obj-coff.o: In function `coff_frob_symbol':
> >> /usr/src/binutils-2.15.97/gas/config/obj-coff.c:1145: undefined
> > reference to `_an_external_name'
>
> This does not happen with the latest sources in the CVS repository, nor
> with the officially released 2.16 sources, so I do not really see this
> as a problem.
>
Hmm...I downloaded 2.15.97 because it was the latest on
ftp://sourceware.org/pub/binutils/snapshots - didn't know there was a
more recent release.

> Cheers
>   Nick
>

Thanks
--
Muhammad Haggag
___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils