if gcc is called with the -save-temps option the resulting object file is 
corrupt.
a call to the linker results in the following error message :
c:\programme\winavr\bin\..\lib\gcc-lib\avr\3.3.1\..\..\..\..\avr\lib\avr5\crtm16.o(.init9+0x0):undefined
reference to 'main'
without using the -save-temps option this error message doesn't appear.
if the file foo.s exists, the error doesn't appear as well (regardless of the
contents of foo.s);foo.s remains unchanged in this case

used calls :
avr-gcc -c -mmcu=atmega16 -save-temps foo.c
avr-gcc -mmcu=atmega16 -o foo.elf foo.o

this problem occurs on different versions (3.3.1, 3.4.1 tested) and on different
OS' (Windows 2000, Windows XP tested)

foo.c (works with other files as well) :
#include <avr/io.h>

int main(void)
{
 while (1);
}

-- 
           Summary: -save-temps option ends with corrupt object file
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pschober at gmx dot ch
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: avr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18549

Reply via email to