[PATCH] New --pe-dll-characteristcs switch for PE ld.

Dave Korn dave.korn.cygwin@googlemail.com
Thu Mar 12 17:28:00 GMT 2009


Dave Korn wrote:
> Nick Clifton wrote:

>> All of these fail because of an internal error in the linker.  For example the
>> i686-pc-cygwin target reports:
>>
>> internal error: aborting at ei386pe.c line 400 in set_pe_name
> 
>   Hadn't got to the rebuild yet, but I see it now.  Danny, there's a mismatch
> between the init[] entry
> 
> +   D(DllCharacteristics, "__dll_characteristics__", 0x0),
> 
> and the call to set_pe_name:
> 
> +   set_pe_name ("__dllcharacteristics__", pe_dll_characteristics);
> 
>   I'll test the obvious fix.

  Still not there yet.  Now I'm getting these (cross-testing from linux):

[davek@ubique binutils]$ diff -pu unpatched-results.log patched-results.log |
grep '^[+-]'
--- unpatched-results.log	2009-03-12 16:48:23.000000000 +0000
+++ patched-results.log	2009-03-12 16:48:31.000000000 +0000
-x86_64-pc-mingw32.log:PASS: check sections 1
+x86_64-pc-mingw32.log:FAIL: check sections 1
-x86_64-pc-mingw32.log:PASS: ld (fastcall symbols)
-x86_64-pc-mingw32.log:PASS: -l: test (preparation)
-x86_64-pc-mingw32.log:PASS: -l: test
-x86_64-pc-mingw32.log:PASS: PE-COFF Long section names (default)
-x86_64-pc-mingw32.log:PASS: PE-COFF Long section names (disabled)
-x86_64-pc-mingw32.log:PASS: PE-COFF Long section names (enabled)
-x86_64-pc-mingw32.log:PASS: PE-COFF Long section names in objects (default)
-x86_64-pc-mingw32.log:PASS: PE-COFF Long section names in objects (disabled)
-x86_64-pc-mingw32.log:PASS: PE-COFF Long section names in objects (enabled)
-x86_64-pc-mingw32.log:PASS: .secrel32
-x86_64-pc-mingw32.log:PASS: align1
-x86_64-pc-mingw32.log:PASS: ld-scripts/align2a
-x86_64-pc-mingw32.log:PASS: ld-scripts/align2b
+x86_64-pc-mingw32.log:FAIL: ld (fastcall symbols)
+x86_64-pc-mingw32.log:FAIL: -l: test (preparation)
+x86_64-pc-mingw32.log:FAIL: -l: test
+x86_64-pc-mingw32.log:FAIL: PE-COFF Long section names (default)
+x86_64-pc-mingw32.log:FAIL: PE-COFF Long section names (disabled)
+x86_64-pc-mingw32.log:FAIL: PE-COFF Long section names (enabled)
+x86_64-pc-mingw32.log:FAIL: PE-COFF Long section names in objects (default)
+x86_64-pc-mingw32.log:FAIL: PE-COFF Long section names in objects (disabled)
+x86_64-pc-mingw32.log:FAIL: PE-COFF Long section names in objects (enabled)
+x86_64-pc-mingw32.log:FAIL: .secrel32
+x86_64-pc-mingw32.log:FAIL: align1
+x86_64-pc-mingw32.log:FAIL: ld-scripts/align2a
+x86_64-pc-mingw32.log:FAIL: ld-scripts/align2b
-x86_64-pc-mingw32.log:PASS: ALIGNOF
-x86_64-pc-mingw32.log:PASS: ASSERT
-x86_64-pc-mingw32.log:PASS: ld-scripts/data
-x86_64-pc-mingw32.log:PASS: ld-scripts/default-script1
-x86_64-pc-mingw32.log:PASS: ld-scripts/default-script2
-x86_64-pc-mingw32.log:PASS: ld-scripts/default-script3
-x86_64-pc-mingw32.log:PASS: ld-scripts/default-script4
-x86_64-pc-mingw32.log:PASS: DEFINED (PRMS 5699)
-x86_64-pc-mingw32.log:PASS: ld-scripts/defined2
-x86_64-pc-mingw32.log:PASS: ld-scripts/defined3
+x86_64-pc-mingw32.log:FAIL: ALIGNOF
+x86_64-pc-mingw32.log:FAIL: ASSERT
+x86_64-pc-mingw32.log:FAIL: ld-scripts/data
+x86_64-pc-mingw32.log:FAIL: ld-scripts/default-script1
+x86_64-pc-mingw32.log:FAIL: ld-scripts/default-script2
+x86_64-pc-mingw32.log:FAIL: ld-scripts/default-script3
+x86_64-pc-mingw32.log:FAIL: ld-scripts/default-script4
+x86_64-pc-mingw32.log:FAIL: DEFINED (PRMS 5699)
+x86_64-pc-mingw32.log:FAIL: ld-scripts/defined2
+x86_64-pc-mingw32.log:FAIL: ld-scripts/defined3
-x86_64-pc-mingw32.log:PASS: EXTERN
+x86_64-pc-mingw32.log:FAIL: EXTERN
-x86_64-pc-mingw32.log:PASS: map addresses
-x86_64-pc-mingw32.log:PASS: ld-scripts/provide-1
-x86_64-pc-mingw32.log:PASS: ld-scripts/provide-2
-x86_64-pc-mingw32.log:PASS: script
-x86_64-pc-mingw32.log:PASS: MRI script
-x86_64-pc-mingw32.log:PASS: MEMORY
-x86_64-pc-mingw32.log:PASS: ld-scripts/size-1
-x86_64-pc-mingw32.log:PASS: SIZEOF
-x86_64-pc-mingw32.log:PASS: weak undefined symbols
+x86_64-pc-mingw32.log:FAIL: map addresses
+x86_64-pc-mingw32.log:FAIL: ld-scripts/provide-1
+x86_64-pc-mingw32.log:FAIL: ld-scripts/provide-2
+x86_64-pc-mingw32.log:FAIL: script
+x86_64-pc-mingw32.log:FAIL: MRI script
+x86_64-pc-mingw32.log:FAIL: MEMORY
+x86_64-pc-mingw32.log:FAIL: ld-scripts/size-1
+x86_64-pc-mingw32.log:FAIL: SIZEOF
+x86_64-pc-mingw32.log:FAIL: weak undefined symbols
[davek@ubique binutils]$

  All the failures are caused by errors like:

/gnu/binutils/obj31708-x86_64-pc-mingw32/ld/ld-new: i386:x86-64 architecture
of input file `tmpdir/asm.o' is incompatible with i386 output

  I suspect this is caused by a stray hunk in Danny's patch:

Index: ld/emultempl/pep.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/pep.em,v
retrieving revision 1.23
diff -c -3 -p -r1.23 pep.em
*** ld/emultempl/pep.em	3 Mar 2009 18:22:11 -0000	1.23
--- ld/emultempl/pep.em	12 Mar 2009 07:25:31 -0000
***************
*** 2,8 ****
  # It does some substitutions.
  test -z "${ENTRY}" && ENTRY="_mainCRTStartup"
  if [ -z "$MACHINE" ]; then
!   OUTPUT_ARCH=${ARCH}
  else
    OUTPUT_ARCH=${ARCH}:${MACHINE}
  fi
--- 2,8 ----
  # It does some substitutions.
  test -z "${ENTRY}" && ENTRY="_mainCRTStartup"
  if [ -z "$MACHINE" ]; then
!   OUTPUT_ARCH=${ARCH}00
  else
    OUTPUT_ARCH=${ARCH}:${MACHINE}
  fi


... so I'll retest after removing it.

    cheers,
      DaveK




More information about the Binutils mailing list