I ran the fail case with -Wl,-u,main and this works for me.

Thanks for all your help and all the work to bring gcc to MSP430.

Robert

On Feb 22, 2012, at 7:24 AM, Peter Bigot wrote:

> On Wed, Feb 22, 2012 at 8:13 AM, Peter Bigot <big...@acm.org> wrote:
>> On Tue, Feb 21, 2012 at 8:40 PM, Robert Wessels <robertin...@yahoo.com> 
>> wrote:
>>> I also noticed that when inspecting the .elf file with msp430-nm the symbol 
>>> main is not present in the no blinky elf file (as expected). The working 
>>> elf file does have the symbol main (as expected). Not sure of the magic 
>>> going in the background but to me it seems the linker simply striped main.
>>> 
>> 
>> In this situation, there's nothing to tell the system that main is
>> referenced, so it isn't included.  I'll see if I can come up with a
>> solution internally (the "obvious" one didn't work), but until then it
>> should work if you add:
>> 
>> -Wl,-u,main
>> 
>> to the link line.  This will force ld to try to find a definition for
>> main and include it in the output.
> 
> And that's how this will be resolved.   The alternative is to have an
> explicit dependency on main in the CRT code; all solutions that
> provide that also increase at flash space, and RAM too if main is no
> longer special.  I believe the number of people wanting to put main
> into an archive is smaller than the number of people trying to write
> code for the value-line chips who could be impacted by such a change,
> and that the burden of having to add this flag is pretty small.
> 
> Note that -Wl,-u,main must appear before whatever archive contains
> main, or ld won't include it.
> 
> Peter


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to