> The map file is telling me a few small functions are being linked in > (memset, memcpy) and I assume that since the standard library wasn't built > with -ffunction-sections or -fdata-sections that it then links the entire > library.
-ffunction-sections affects multiple functions in the same object. It has no effect on separate objects. Functions like memcpy() and memset() are in separate source files in the library, so will be linked in or not depending only on whether or not they're actually needed. > Is this also a side effect of the library not being build with those > sections flags? If so, why isn't the library built like that for > cases like this where you want to have only a few small functions? One could argue that the library should be built with whatever flags the user specifies. This quickly turns into thousands, if not millions, of permutations of builds, and is not practical. The only way to solve this is to build the whole library as part of your project, so you can choose the flags you want. Also, the -ffunction-section and -fdata-section flags are mostly useless for the standard libraries *anyway*, as, as I mentioned already, they're already broken into one function per section. The -minrt option is designed to work mostly with the startup code, by selectively linking in parts of (what is normally) crt0.s based on a more "global" knowledge of features used by the program. If you use a C++ function that uses exceptions, the exception startup gets linked in. Without -minrt, the exception startup gets linked in even if nothing uses exceptions. ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users