[PATCH 1/3] mtd-utils: new memory wrappers

Artem Bityutskiy dedekind1 at gmail.com
Thu Sep 30 02:56:32 EDT 2010


On Thu, 2010-09-30 at 02:18 -0400, Mike Frysinger wrote:
> issues (not good or bad, but just are):
>  - change "#define PROGRAM_NAME" to "const char program_name[]"
>  - errors thrown up by libraries would be flagged as part of the
> program, and not part of the library (i.e. libubifs)
>  - unused functions would take up space in final exe
> 
> the first is easy to change.  the 2nd i think is OK (and maybe even
> less confusing for the user when reviewing error output).  the 3rd i'd
> like to make sure we address.
> 
> two possible solutions to 3rd one.  one ugly but portable, one nice
> but gnu-specific.  although we already use gnu-specific code and
> flags, so maybe that isnt an issue (no one has complained yet).
> 
> ugly: create lib/common/ and put every function into its own file and
> merge into libmtd.a.  linker only pulls in objects (funcs) when
> needed.
> nice: use -ffunction-sections -fdata-sections -Wl,--gc-sections.
> additional advantage of saving space across all linked in library code
> and not just common.h stuff.

Sorry, I never dealt with -ffunction-sections stuff, I do not know the
price of this, so I basically cannot judge. But of course removing
unused code is a good thing to do. So you seem to be more competent in
these question, just go ahead with you nice cleanups!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list