bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/12184] New: explicite --enable-targets ./configure option breaks


From: pluto at agmk dot net
Subject: [Bug ld/12184] New: explicite --enable-targets ./configure option breaks mingw binaries.
Date: Wed, 3 Nov 2010 10:55:32 +0000

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

           Summary: explicite --enable-targets ./configure option breaks
                    mingw binaries.
           Product: binutils
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
              Host: x86_64-gnu-linux
            Target: *-pc-mingw32
             Build: x86_64-gnu-linux


hi,

i've discovered some weird problem with cross-binutils configured
for {i686,x86_64}-pc-mingw32 targets with an explicite option:

--enable-targets="i386-linux,x86_64-linux,i386-mingw32,x86_64-mingw32"

with this option linker produces broken binaries.

trivial testcase...

#include <stdio.h>
int main()
{
        puts( "hello mingw world." );
        return 0;
}

...assembled/lined with binutils configured WITHOUT --enable-targets
renders to proper .o and .exe:

% less 32.good/test.o.asm

(...)
00000000 <_main>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   83 e4 f0                and    $0xfffffff0,%esp
   6:   83 ec 10                sub    $0x10,%esp
   9:   e8 00 00 00 00          call   e <_main+0xe>
                        a: DISP32       ___main
   e:   c7 04 24 00 00 00 00    movl   $0x0,(%esp)
                        11: dir32       .rdata
  15:   e8 00 00 00 00          call   1a <_main+0x1a>
                        16: DISP32      _puts
  1a:   31 c0                   xor    %eax,%eax
  1c:   c9                      leave
  1d:   c3                      ret

% less 32.good/test.exe.asm

(...)
004017d0 <_main>:
  4017d0:       55                      push   %ebp
  4017d1:       89 e5                   mov    %esp,%ebp
  4017d3:       83 e4 f0                and    $0xfffffff0,%esp
  4017d6:       83 ec 10                sub    $0x10,%esp
  4017d9:       e8 52 08 00 00          call   402030 <___main>
  4017de:       c7 04 24 a8 40 40 00    movl   $0x4040a8,(%esp)
  4017e5:       e8 96 0b 00 00          call   402380 <_puts>
  4017ea:       31 c0                   xor    %eax,%eax
  4017ec:       c9                      leave
  4017ed:       c3                      ret
(...)
00402380 <_puts>:
  402380:       ff 25 c8 71 40 00       jmp    *0x4071c8
  402386:       90                      nop
  402387:       90                      nop

but WITH explcite --enable-targets we get correct .o and broken .exe:

% less 32.bad/test.o.asm

(...)
00000000 <_main>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   83 e4 f0                and    $0xfffffff0,%esp
   6:   83 ec 10                sub    $0x10,%esp
   9:   e8 f2 ff ff ff          call   0 <_main>
                        a: DISP32       ___main
   e:   c7 04 24 00 00 00 00    movl   $0x0,(%esp)
                        11: dir32       .rdata
  15:   e8 e6 ff ff ff          call   0 <_main>
                        16: DISP32      _puts
  1a:   31 c0                   xor    %eax,%eax
  1c:   c9                      leave
  1d:   c3                      ret

% less 32.bad/test.exe.asm
(...)
004017d0 <_main>:
  4017d0:       55                      push   %ebp
  4017d1:       89 e5                   mov    %esp,%ebp
  4017d3:       83 e4 f0                and    $0xfffffff0,%esp
  4017d6:       83 ec 10                sub    $0x10,%esp
  4017d9:       e8 44 08 00 00          call   402022 <___do_global_ctors+0xd2>
                                                ^^^^^ BAD!
  4017de:       c7 04 24 a8 40 40 00    movl   $0x4040a8,(%esp)
  4017e5:       e8 7c 0b 00 00          call   402366 <__amsg_exit+0x6>
                                                ^^^^^ BAD!
  4017ea:       31 c0                   xor    %eax,%eax
  4017ec:       c9                      leave
  4017ed:       c3                      ret
(...)
00402380 <_puts>:
  402380:       ff 25 c8 71 40 00       jmp    *0x4071c8
  402386:       90                      nop
  402387:       90


afaics more emulations suported by binutils (with --enable-targets option)
are problematic.

% i686-pc-mingw32-ld -V
GNU ld (Linux/GNU Binutils) 2.20.51.0.12.20101020
  Supported emulations:
   i386pe
   elf_i386
   i386linux
   elf_x86_64
   elf_l1om
   i386pep

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

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