IA64 PE/COFF (efi-app-ia64) image has bad VirtualSize field

Nick Clifton nickc@redhat.com
Thu Jan 8 11:45:00 GMT 2004


Hi Brian,

> Although I tried your commands above with binutils 2.14.90.0.4, and
> got a zero for VirtualSize.  So it seems to be binutils version
> related.  Do you have an older build handy you could try?

Yes - in fact I was able to use a binary chop method to locate the
exact problem.  It was this change to peicode.h:

  2003-04-03  Nick Clifton  <nickc@redhat.com>

	* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss
	differently for object files and executables.
	* peicode.h (coff_swap_scnhdr_in): Only set the s_size field
	for object files or for executables who have not already
	initialised the field.
	* libpei.h (bfd_pe_executable_p): New macro.  Return true if
	the PE format bfd is an executable.

which was later fixed by this patch:

  2003-08-18  Andreas Schwab  <schwab@suse.de>

	* libpei.h (bfd_pe_executable_p): Also recognize efi-app
	executables.

Hence applying the attached patch to your 2.14 sources and then
rebuilding/reinstalling should fix the problem.

Cheers
        Nick

Index: bfd/libpei.h
===================================================================
RCS file: /repositories/repositories/sourceware/src/bfd/libpei.h,v
retrieving revision 1.10
diff -c -3 -p -r1.10 libpei.h
*** bfd/libpei.h	3 Apr 2003 11:13:26 -0000	1.10
--- bfd/libpei.h	8 Jan 2004 11:32:07 -0000
*************** bfd_boolean _bfd_XX_bfd_copy_private_sec
*** 332,335 ****
    PARAMS ((bfd *, asection *, bfd *, asection *));
  
  /* Macro: Returns true if the bfd is a PE executable as opposed to a PE object file.  */
! #define bfd_pe_executable_p(abfd)  (strncmp ((abfd)->xvec->name, "pei-", 4) == 0)
--- 332,338 ----
    PARAMS ((bfd *, asection *, bfd *, asection *));
  
  /* Macro: Returns true if the bfd is a PE executable as opposed to a PE object file.  */
! #define bfd_pe_executable_p(abfd) \
!   (strncmp ((abfd)->xvec->name, "pei-", 4) == 0		\
!    || strncmp ((abfd)->xvec->name, "efi-app-", 8) == 0)
! 
                



More information about the Binutils mailing list