From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8796 Path: news.gmane.org!not-for-mail From: Denys Vlasenko Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] configure: add gcc flags for better link-time optimization Date: Wed, 28 Oct 2015 11:05:56 +0100 Message-ID: References: <1445603426-4827-1-git-send-email-vda.linux@googlemail.com> <20151023131202.GI10551@port70.net> <20151027012131.GR8645@brightrain.aerifal.cx> <20151027210123.GZ8645@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1446026807 25343 80.91.229.3 (28 Oct 2015 10:06:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Oct 2015 10:06:47 +0000 (UTC) To: musl , Rich Felker Original-X-From: musl-return-8809-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 28 11:06:31 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZrNck-0005Cs-6P for gllmg-musl@m.gmane.org; Wed, 28 Oct 2015 11:06:30 +0100 Original-Received: (qmail 28560 invoked by uid 550); 28 Oct 2015 10:06:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 28532 invoked from network); 28 Oct 2015 10:06:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=UfJ0keaPxBsfha26Z5bSjrVpzAlbiclRm42eFWixh5Q=; b=qOY6zpqP8xdTg0RMbcLg4d0a9uT3jRLvlyZe3o7+8xFUwdKV/p61icOUgVoX+qSJq6 eYuTQg8p/RkWVJFWQ1IaU3OKV5/jeqVlJfzVbIEzVAW9ts/NlnHyDzcADCQ0/vJrxTjf C8kKS55kFmfxAMWuvJv6utd9u3s32+IxkW/OaDcJgcNruvFYe7n236wOXvhZaCZ+P4P+ +jLHiDKIH0ebYdG3BaUafec0dFT4R26TQ+6Bbn71lgVeqWhkZPCCfG+926pUKthUjWC4 xIZJOPBc2RP4o5VB1Zk8hMZ8AwJ/ZktRva8pDGVIK+56bTZ4WStXlsNd8Opg53FlhZfb w7YQ== X-Received: by 10.140.101.105 with SMTP id t96mr55297576qge.53.1446026775556; Wed, 28 Oct 2015 03:06:15 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:8796 Archived-At: On Wed, Oct 28, 2015 at 10:53 AM, Denys Vlasenko wrote: >> Did you see any symbols disappear when adding --gc-sections? > > Yes, I do. > > $ nm --size-sort busybox_unstripped >busybox_unstripped.nm > $ nm --size-sort busybox_unstripped--gc-sections >>busybox_unstripped--gc-sections.nm > $ diff -u busybox_unstripped.nm busybox_unstripped--gc-sections.nm | > grep '^[^ @]' > > --- busybox_unstripped.nm 2015-10-28 10:48:16.362304813 +0100 > +++ busybox_unstripped--gc-sections.nm 2015-10-28 10:48:26.056294599 +0100 > -0000000000000001 t reinit_unicode_for_ash > -0000000000000001 t reinit_unicode_for_hush > -0000000000000007 T xmalloc_sockaddr2host > -0000000000000008 b cur.1926 > -0000000000000008 b dummy > -0000000000000008 b dummy_file > -0000000000000008 b end.1927 > -0000000000000008 b lock.1928 > -0000000000000008 T xstrtoi_range > -0000000000000008 T xstrtoll_range > -000000000000000a T bb_internal_getpwnam_r > -000000000000000a T ipneigh_main > -000000000000000c T xsocket_stream > -000000000000000e T xgid2group > -0000000000000010 T selinux_or_die > -0000000000000011 T xatoi_range_sfx > -0000000000000011 T xatou_range_sfx > -0000000000000012 T xstrtoi > -0000000000000013 T xatoll_range_sfx > -0000000000000015 T replace > -0000000000000017 T xatoi_sfx > -0000000000000017 T xspawn > -0000000000000018 T replace_underscores > -000000000000001a T bb_iswspace > -000000000000001b T bb_internal_setpwent > -000000000000001b T xgetgrgid > -000000000000001c T llist_rev > -000000000000001c T xstrtoll > -000000000000001d T xread_char > -000000000000001e T monotonic_ns > -0000000000000021 T xatoll_sfx > -0000000000000021 T xmalloc_fgetline_str > -0000000000000022 T bb_iswpunct > -0000000000000023 T bb_iswalnum > -000000000000002f T bb_internal_endpwent > -000000000000002f T isrv_want_wr > -0000000000000033 T bb_delete_module > -000000000000003c T index_in_str_array > -000000000000003e T rewind > -0000000000000043 T is_suffixed_with > -000000000000004b T moderror > -0000000000000054 T executable_exists > -000000000000005a T rta_addattr_l > -0000000000000062 T string_to_llist > -0000000000000088 T bb_init_module > -00000000000000ae T bb_herror_msg > -00000000000000c3 T parse_cmdline_module_options > -000000000000010d T __simple_malloc This was with Rob's preconpiled system-image-x86_64. Now with musl built with -ffunction-sections -fdata-sections: --- busybox_unstripped.nm 2015-10-28 11:02:13.047555187 +0100 +++ busybox_unstripped--gc-sections.nm 2015-10-28 11:02:04.290531243 +0100 -0000000000000001 T __cxa_finalize -0000000000000001 t dummy -0000000000000001 t dummy -0000000000000001 t dummy -0000000000000001 t dummy -0000000000000001 t reinit_unicode_for_ash -0000000000000001 t reinit_unicode_for_hush -0000000000000003 t dummy -0000000000000004 T ether_line -0000000000000004 T ether_ntohost -0000000000000005 T fseek -0000000000000005 T ftell -0000000000000005 T __isalnum_l -0000000000000005 W isalnum_l -0000000000000005 T __iswalnum_l -0000000000000005 W iswalnum_l -0000000000000005 T __iswalpha_l -0000000000000005 W iswalpha_l -0000000000000005 T __iswblank_l -0000000000000005 W iswblank_l -0000000000000005 T __iswcntrl_l -0000000000000005 W iswcntrl_l -0000000000000005 T __iswctype_l -0000000000000005 W iswctype_l -0000000000000005 T __iswgraph_l -0000000000000005 W iswgraph_l -0000000000000005 T __iswlower_l -0000000000000005 W iswlower_l -0000000000000005 T __iswprint_l -0000000000000005 W iswprint_l -0000000000000005 T __iswpunct_l -0000000000000005 W iswpunct_l -0000000000000005 T __iswspace_l -0000000000000005 W iswspace_l -0000000000000005 T __iswupper_l -0000000000000005 W iswupper_l -0000000000000005 T __iswxdigit_l -0000000000000005 W iswxdigit_l -0000000000000005 T strtoimax -0000000000000005 W __strtoimax_internal -0000000000000005 T strtoumax -0000000000000005 W __strtoumax_internal -0000000000000005 T __toread_needs_stdio_exit -0000000000000005 T __towlower_l -0000000000000005 W towlower_l -0000000000000005 T __towrite_needs_stdio_exit -0000000000000005 T __towupper_l -0000000000000005 W towupper_l -0000000000000005 T __wctype_l -0000000000000005 W wctype_l -0000000000000006 b a.2175 -0000000000000007 T xmalloc_sockaddr2host -0000000000000008 b cur.1926 -0000000000000008 b dummy -0000000000000008 b dummy_file -0000000000000008 b end.1927 -0000000000000008 b lock.1928 -0000000000000008 D __stderr_used -0000000000000008 T xstrtoi_range -0000000000000008 T xstrtoll_range -000000000000000a T bb_internal_getpwnam_r -000000000000000a T ether_aton -000000000000000a T ipneigh_main -000000000000000a T strtold -000000000000000a W __strtold_l -000000000000000a W strtold_l -000000000000000c T xsocket_stream -000000000000000e T posix_openpt -000000000000000e T xgid2group -0000000000000010 T selinux_or_die -0000000000000011 T __tolower_l -0000000000000011 W tolower_l -0000000000000011 T xatoi_range_sfx -0000000000000011 T xatou_range_sfx -0000000000000012 T __isblank_l -0000000000000012 W isblank_l -0000000000000012 T xstrtoi -0000000000000013 T xatoll_range_sfx -0000000000000015 T replace -0000000000000017 T umount -0000000000000017 T xatoi_sfx -0000000000000017 T xspawn -0000000000000018 T replace_underscores -000000000000001a T bb_iswspace -000000000000001b T bb_internal_setpwent -000000000000001b T xgetgrgid -000000000000001c T llist_rev -000000000000001c T xstrtoll -000000000000001d T xread_char -000000000000001e T monotonic_ns -0000000000000021 T xatoll_sfx -0000000000000021 T xmalloc_fgetline_str -0000000000000022 T bb_iswpunct -0000000000000022 T endusershell -0000000000000022 T strtof -0000000000000022 W __strtof_l -0000000000000022 W strtof_l -0000000000000023 T bb_iswalnum -000000000000002f T bb_internal_endpwent -000000000000002f T __do_orphaned_stdio_locks -000000000000002f T isrv_want_wr -0000000000000033 T bb_delete_module -0000000000000034 T fstatvfs -0000000000000034 W fstatvfs64 -0000000000000034 T statvfs -0000000000000034 W statvfs64 -0000000000000035 T setlogmask -000000000000003c T index_in_str_array -000000000000003e T rewind -0000000000000043 T is_suffixed_with -000000000000004b T moderror -000000000000004f W fstatfs -000000000000004f T __fstatfs -000000000000004f W fstatfs64 -0000000000000054 T addmntent -0000000000000054 T executable_exists -000000000000005a T rta_addattr_l -000000000000005b T __timedwait -0000000000000062 T string_to_llist -0000000000000070 T __strcasecmp_l -0000000000000070 W strcasecmp_l -0000000000000088 T bb_init_module -000000000000008b T __strncasecmp_l -000000000000008b W strncasecmp_l -000000000000009c t fixup -00000000000000ae T bb_herror_msg -00000000000000c3 T parse_cmdline_module_options -000000000000010c T __simple_malloc Because now objects live in separate sections each, ld can drop more of them.