what is the matter with gcc in cygwin?

Xugang Zhang zhxg@263.net
Wed Dec 6 05:25:00 GMT 2000


hello all !
      why the gcc always says error?
      my program is like this  :
     
     .text
    .globl main
    main:
        pushl %eax
        popl  %eax
    ret
    a very simple one , the file name is t.s

    the link script is this:
    OUTPUT_FORMAT("ihex")
    SECTIONS
     {
      . = 0x0;
       .text : { *(.text) }
      }
     also a very simple on ,  the file name is t.cmd
     when I use the command
     gcc t.s -o t -T t.cmd
     it said:
     /usr/bin/ld: PE operatons on non PE file.
    collect2: ld returned 1exit status

    when I omit the line OUTPUT_FORMAT("ihex") in t.cmd
    then use the command
    gcc t.s -o t -T t.cmd
    then it said:
    /usr/lib/libcygwin.a(libcmain.o)(.text+0x6a):libcmain.c:undefined reference to 'WinMain@16'
    /usr/lib/libcygwin.a(_cygwin_crt0_common.o)(.text+0xee):_cygwin_crt0_c:undefined
   reference to '_data_start_'
   /usr/lib/libcygwin.a(_cygwin_crt0_common.o)(.text+0xfa):_cygwin_crt0_c:undefined
   reference to '_data_end_'
  /usr/lib/libcygwin.a(_cygwin_crt0_common.o)(.text+0x101):_cygwin_crt0_c:undefined
   reference to '_bss_start_'
  /usr/lib/libcygwin.a(_cygwin_crt0_common.o)(.text+0x108):_cygwin_crt0_c:undefined
   reference to '_data_end_'
  /usr/bin/ld: bfd assertion fail /cygnus/netrel/src/binutils -20001029 -1/bfd/stabs.c : 600
  collect2: ld returned 1 exit status

  why the gcc always says error? the gcc version is 2.95.2-3  
  why the gcc ld always link with libcygwin.a ?I don't want it link with libcygwin.a.

 thanks a lot!
    
   
     
     
   


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list