From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Carlier Date: Mon, 15 Nov 2010 13:13:03 +0100 Subject: [U-Boot] [PATCH v4] Switch from archive libraries to partial linking In-Reply-To: <20101115105407.2A24714EA7E@gemini.denx.de> References: <1289253872-16891-1-git-send-email-sebastien.carlier@gmail.com> <201011100157.31202.vapier@gentoo.org> <20101110080708.GA8145@safe.home.local> <20101115075129.9C820134FEF@gemini.denx.de> <20101115080950.GA26767@safe.home.local> <20101115105407.2A24714EA7E@gemini.denx.de> Message-ID: <20101115121303.GD26767@safe.home.local> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2010-11-15 11:54:07, Wolfgang Denk wrote: > > I notice that the patch affects the size of the resulting U-Boot > images. > > For example: > > Configuring for MiniFAP - Board: TQM5200, Options: MINIFAP > text data bss dec hex filename > 358144 35208 303248 696600 aa118 ./u-boot before > 361340 35824 303332 700496 ab050 ./u-boot after > ------------------------------- > Delta: +3896 Bytes > > For other boards it's only a few hundred bytes, but why do we see > such big increase here? In this case, these libraries contribute 3260 bytes in unused definitions: - fs/fat/libfat.a: (1712 bytes) file.o: 00000000 00000004 d current_filesystem 00000004 00000200 D file_cwd 00000000 00000018 d filesystems 00000250 00000244 T file_cd 000001d0 00000080 T file_detectfs 00000000 00000048 T file_getfsname 0000011c 000000b4 T file_ls 00000048 000000d4 T file_read - lib/libfdt/libfdt.a (1440 bytes) fdt_sw.o: 00000000 0000006c T fdt_add_reservemap_entry 0000028c 000000dc T fdt_begin_node 00000504 0000009c T fdt_create 000000b4 00000078 T fdt_end_node 0000012c 00000160 T fdt_finish 0000006c 00000048 T fdt_finish_reservemap 00000368 0000019c T fdt_property - drivers/pci/libpci.a: (108 bytes) pci_indirect.o: 000001dc 0000006c T pci_setup_indirect In each case, a whole object file contains exactly the unused definitions, and could be excluded in the respective Makefile. Re. my previous comment -- in other places objects get large when header files define a lot of static inline functions, but these ('t' type) definitions get squashed together during linking and do not add up. If however a large static inline function is defined but never used, it will increase final binary size. -- Sebastien