From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manfred Hollstein To: mrs@windriver.com Cc: cih@wahoo.com.tw, gcc@gcc.gnu.org Subject: Re: GCC For Embedded!? Date: Mon, 03 Jan 2000 06:06:00 -0000 Message-id: <14448.43924.819828.84599@saturn.hollstein.net> References: <199912282341.PAA00765@kankakee.wrs.com> X-SW-Source: 2000-01/msg00032.html On Tue, 28 December 1999, 15:41:39, mrs@windriver.com wrote: > > Date: Thu, 23 Dec 1999 10:41:03 +0800 > > From: CIH > > > static void XYZ() > > { > > // The XYZ function code is very big... > > } > > > My god... I almost try all gcc command options, but "test" file still > > has the very big function "XYZ"... > > compile with -ffunction-sections, and run the linker with > --gc-sections (sp?). Also, add -fdata-sections; and, make sure, you've used these flags when building your libs, too... Use this: $ ${target}-gcc -ffunction-sections -fdata-sections -c -Wall test.c $ ${target}-nm test.o | grep XYZ 00000000 t XYZ $ ${target}-gcc -ffunction-sections -fdata-sections -Wl,--gc-sections test.o $ ${target}-nm a.out | grep XYZ $ Cheers. l8er manfred