Re: TI compiler
Peter Bigot <[email protected]> Sun, 5 Mar 2017 10:11:22 -0600
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.user |
|---|---|
| Message-ID | <CAPOJ94PeiHBYc1CiV9B1a4Z7sdVMRLQOfverej5tJEfr6eYt9w@mail.gmail.com> |
--===============8776975786240703155== Content-Type: multipart/alternative; boundary=f403045c3c08af39930549fe0799 --f403045c3c08af39930549fe0799 Content-Type: text/plain; charset=UTF-8 On Fri, Mar 3, 2017 at 12:30 PM, DJ Delorie <[email protected]> wrote: > Also, if you're REALLY constrained to size, you might consider getting > the crt0.S source file from newlib and modifying it yourself to really > strip out the parts you don't need. Most embedded code really only > needs to set up the stack and watchdog, then jump to main(). > Be careful with this. TI's Code Composer compiler originally had a stripped down crt0 that didn't bother clearing the bss section. This meant any static variable definition (including globals) would not necessarily be cleared on power up. So if you rely on a variable being null to indicate that some initialization is necessary your program may or may not work. The advice is also dubious if you're using C++ as there may be static constructors that need to be invoked (and yes, modern C++ if used carefully is appropriate for embedded programming even on constrained chips like MSP430). In short, if you muck with the crt0 code be very sure you know the effect of stripping things out. Peter --f403045c3c08af39930549fe0799-- --===============8776975786240703155== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot --===============8776975786240703155== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Mspgcc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mspgcc-users --===============8776975786240703155==--