Correction for Test 3:
msp430-gcc core.a main.o -mmcu=msp430g2452 -Wl,-Map=hello.map -o hello.elf
should read:
msp430-gcc core.a foo.o -mmcu=msp430g2452 -Wl,-Map=hello.map -o hello.elf

Robert
----- Original Message -----
From: Robert Wessels <robertin...@yahoo.com>
To: "mspgcc-users@lists.sourceforge.net" <mspgcc-users@lists.sourceforge.net>
Cc: 
Sent: Monday, February 20, 2012 8:31 PM
Subject: Re: main as part of an archive created with msp430-ar

Hi All,
 
I just ran into an issue and am wondering if I am missing something.
 
main.c implements int main(void)
foo.c implements void blink(void)
 
main() calls blink()
 
main.c and foo.c are compiled like so:
msp430-gcc -c -mmcu=msp430g2452 -g -Os -Wall -Wunused -IInclude -o main.o main.c
msp430-gcc -c -mmcu=msp430g2452 -g -Os -Wall -Wunused -IInclude -o foo.o foo.c
 
Test 1:
If I link main.o and foo.o with msp430-gcc main.o foo.o -mmcu=msp430g2452 
-Wl,-Map=hello.map -o hello.elf all is blinky blinky.
 
Test 2:
when I create an archive core.a that holds foo.o with:
 
msp430-ar rcsv core.a foo.o
 
and then link the final elf file with:
 
msp430-gcc core.a foo.o -mmcu=msp430g2452 -Wl,-Map=hello.map -o hello.elf
 
All again is blinky blinky.
 
Test 3:
The problem surfaces when I create an archive core.a that holds main.o with:
 
msp430-ar rcsv core.a main.o
 
and then link the final elf file with:
 
msp430-gcc core.a main.o -mmcu=msp430g2452 -Wl,-Map=hello.map -o hello.elf
 
All is dark.
 
I ran the same test with a simple "hello world" compiled for x86 using gcc and 
ar under cygwin and all is fine in all 3 cases.
 
Any idea why this does not work for msp430? I looked at the linker scripts but 
that only resulted in more darkness.
 
Regards,
 
Robert Wessels


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to