Jump to content
Sign in to follow this  
skytoastar

Linkers, GCC, and Code Size Limits

Recommended Posts

I tried my best Google here and at e2e with no luck. Perhaps my Google skills are weak, though.

 

So I know the code size limit of the free license for CCS is 16k. But I don't understand how it calculates this. For example, the ez430-Chronos watch has a project that compiles using the free, limited license. It does this by linking some precompiled binary .lib files rather than compiling those fresh. So, first question, does it know those lib files were compiled using a non-free license? And how does it calculate that 16k? Because after the linker is done, the final binary is just under 32k though I know some of it was previously compiled. I assume it's only counting the newly compiled parts but I can't find a simple way to know how much that is. But could I just divide a project into mini-projects and then link them in to get around the code size limit?

 

Second question, slaa664 says that GCC and TI's compiler are ABI compatible. Doesn't that mean I get the benefit of TI's compiler with no code size restriction by compiling with TI and linking with GCC? I haven't had a chance to try this but I was wondering if anyone else had or what everyone's thoughts are on this. I could imagine problems with debugging. Obviously COFF files would need migration. Thoughts?

Share this post


Link to post
Share on other sites

For your second question, why don't you just compile it with GCC. You may need to port it though. I have never had separate compiler and linker vendors. Maybe some of the experts can help on this( @@pabigot, @@spirilis, @jpnorair).

 

 

There is also OpenChronos-ng.

 

The wiki on TI says this:

The projects for Chronos are delivered in both full source and pre-compiled library options to avoid any code size restrictions.

So I guess, you can go over 16K if you use pre-compiled libs.

Share this post


Link to post
Share on other sites

I've been reading of people having huge code size results from compiling with GCC vs pre-TI GCC. That motivates me to use TI's compiler. And it's just one of those things where I want to know, "Can I? Is it possible?"

 

I started experimenting myself this past weekend with the Chronos code (removing the COFF-only Bluerobin code) but ran into some issues. So I tried making the blink example code into a library and linking it, just the make the problem simpler, and I ran into problems cross-linking (TI compiles the .lib, GCC links it into another project) (no problems with TI's linker). It had to do with undefined symbols in the lib file but I ran out of weekend to keep working on it. Time for me to start learning about .a, .obj, and .lib files more.

Share this post


Link to post
Share on other sites

Personally I have never come close to reaching code size of my microcontrollers, so compiled cose size down't bother me so much. (Apart from when I was working with 512b or 2kb msp430 value line parts)

 

The code limit is enforced at the last step basically. any pre-compiled libaries are not counted. In the Chronos project they make use of binary only Bluerobin stuff, aswell as a compiled library for module drivers.

 

 

As a side note, I found that you can just call "make" outside of the IDE, and it compiles over the code limit just fine. However this does remove debugging support from the IDE, since it will try to compile again when invoking the debugger....

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...