bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BFD 2.16.1 "assertion failure" and "internal error"


From: Daniel Marques
Subject: Re: BFD 2.16.1 "assertion failure" and "internal error"
Date: Wed, 13 Jul 2005 15:10:23 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)



I think that the simplest change we could make would be to have BFD detect object files with a magic number of 0x188 and then have it issue an error message along the lines of "please decompress this file before passing it to BFD". What do you think ?

Nick,

This makes sense, so I've attached a patch that does just this.

Let me know when/if you incorporate it to the cvs tree, and when the patch that you proposed makes it in.

:) Then we can focus on the Sparc stuff :)

Thanks for all your help.

Dan
diff -r -c binutils-2.16.1-orig/bfd/coff-alpha.c 
binutils-2.16.1/bfd/coff-alpha.c
*** binutils-2.16.1-orig/bfd/coff-alpha.c       Wed Jul 13 14:42:11 2005
--- binutils-2.16.1/bfd/coff-alpha.c    Wed Jul 13 14:54:38 2005
***************
*** 482,488 ****
    struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
  
    if (ALPHA_ECOFF_BADMAG (*internal_f))
!     return FALSE;
  
    return TRUE;
  }
--- 482,497 ----
    struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
  
    if (ALPHA_ECOFF_BADMAG (*internal_f))
!     {
!       if (ALPHA_ECOFF_COMPRESSEDMAG (*internal_f))
!       {
!         (*_bfd_error_handler)
!           (_("%B: Cannot handle compressed Alpha binaries.\n"
!              "   Use compiler flags, or objZ, to generate uncompressed 
binaries."),
!            abfd);
!       }
!       return FALSE;
!     }
  
    return TRUE;
  }
diff -r -c binutils-2.16.1-orig/include/coff/alpha.h 
binutils-2.16.1/include/coff/alpha.h
*** binutils-2.16.1-orig/include/coff/alpha.h   Wed Jul 13 14:42:48 2005
--- binutils-2.16.1/include/coff/alpha.h        Wed Jul 13 14:45:12 2005
***************
*** 34,39 ****
--- 34,45 ----
  #define ALPHA_ECOFF_BADMAG(x) \
    ((x).f_magic != ALPHA_MAGIC && (x).f_magic != ALPHA_MAGIC_BSD)
  
+ #define ALPHA_ECOFF_COMPRESSEDMAG(x) \
+   ((x).f_magic == ALPHA_MAGIC_COMPRESSED )
+ 
+ 
+ 
+ 
  /* The object type is encoded in the f_flags.  */
  #define F_ALPHA_OBJECT_TYPE_MASK      0x3000
  #define F_ALPHA_NO_SHARED             0x1000
diff -r -c binutils-2.16.1-orig/include/coff/ecoff.h 
binutils-2.16.1/include/coff/ecoff.h
*** binutils-2.16.1-orig/include/coff/ecoff.h   Wed Jul 13 14:42:48 2005
--- binutils-2.16.1/include/coff/ecoff.h        Wed Jul 13 14:44:24 2005
***************
*** 40,45 ****
--- 40,46 ----
  
  /* Alpha magic numbers used in filehdr.  */
  #define ALPHA_MAGIC 0x183
+ #define ALPHA_MAGIC_COMPRESSED 0x188
  #define ALPHA_MAGIC_BSD 0x185
  
  /* Magic numbers used in a.out header.  */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]