The simplest way I've found to do this is to put each function in its own .c
file and let the linker ignore any unneeded files.  If several .c files
share a common .h file, then only the code that is actually used will get
linked into the final binary, providing the behaviour you wanted, without
requiring any special tricks with the linker.

I've never tried the command line arguments you mention.

Neil



On 2/2/07, "Jürgen Schlinker" < [email protected]> wrote:
>
> Hi,
>
> I wanted to use msp430-gcc v. 3.3.6 with the following idea:
>
> - Use --ffunction-sections for compiling (each function in individual
> sections).
> - Use --gc-section for linking to remove the sections that are not used.
>
> Somehow when I enable --gc-sections msp430-size shows that data- and
> text-sections and gone which I checked with readelf.
> But in addition to that using --function-sections seems not to work the
> way as I thought. Using gcc 4.1.2 worked for a small sample-project. The
> functions were put in individual sections, but using the mspgcc didn't work.
>
> Is this functionality not correctly working with 3.3.6 or am I missing
> something?
>
> thanks in advance
>
> juergen
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services,
> security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>


Reply via email to