From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14557 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Khem Raj Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: size of executable Date: Mon, 12 Aug 2019 11:16:39 -0700 Message-ID: References: <20190812171851.GS9017@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="225270"; mail-complaints-to="usenet@blaine.gmane.org" To: musl@lists.openwall.com Original-X-From: musl-return-14573-gllmg-musl=m.gmane.org@lists.openwall.com Mon Aug 12 20:17:25 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hxEsi-000wRh-VH for gllmg-musl@m.gmane.org; Mon, 12 Aug 2019 20:17:21 +0200 Original-Received: (qmail 5881 invoked by uid 550); 12 Aug 2019 18:17:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5863 invoked from network); 12 Aug 2019 18:17:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=Q91+az6uAkMmCvKlmk4iqb35m11qw0dkT1obT2BQ9JM=; b=oJonbURDknQXYxsUHXJ+xPMQ1UdF/j52LqN8hAiSztTbv6RiXiDvKrH6X2OtkkhXAT 8hbLyYlXYNfKxUU/6S7NWB4F3kg5XbtI1C1SUY8f+vbh76thObIi56qo91UqBw20IHBx JVpWZQBSfjjTNluKQtSaaI5RNqA6lElZTwvmcxsgKnosHHDhodEpSouct7/yebIDnK5U fFrjzkt+97RKeTTBbhZ0x0SYMfvGwaJV3r0XVhuju7P+eevMD1V6eq5RAH/VGYpIFHkk M2rHCnPVQLprXTG6+Vv2IXXsA9XT/+N/w1izxC4ahgva0uwtskudadcLmtpBdDyYMl9k vLFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=Q91+az6uAkMmCvKlmk4iqb35m11qw0dkT1obT2BQ9JM=; b=MUK/huGIW1WGXWUyalGiyYqHgVdwOHSWCfEr8ZNjBy02wVQqXd2v0Adx3I34wQf8NK K502gBwjFKQNsQxFEOmzLl0rj3J+1gXTfEKqlTUlArlQxeA6UUVJ5GVQdx8FmAzBt7Ln 8ewteKw9YXPc12EQyoV8hjjhgOsTNz9KBesxDY/iCdAlYKVhj9ebiWabCnDW91HBmndD XqN7Id9QZ9ZRGjA2tAmbjJEHA8JaSIKo1gnZ5YPX2H39838aU8kG80wNefgu5f8q0AHT i1ujPLA8TlwzaVmYiR9Sd7CexvhaOPEOrc+jzfrAF5l+3YOjBDk9a1pfQYK2k0VY4ymy UvHA== X-Gm-Message-State: APjAAAUDk+/srsTCo0jiRZw7/VOB0B55Yd3dmCZNeIhXLBhgLM6gC0UR IvxO9D/TDogyZNNqHwnYyHA8gXay/EPcHMZaiUZ/5oCq X-Google-Smtp-Source: APXvYqxfjOKbjbv7dBR45x6nOu3HMQpKgzNMmfwktLe7vPCyXeZIVeM9rKXxzTpSo+phljdwDx5ub7Ky6lp9Qwhj1Ts= X-Received: by 2002:a0c:ae5a:: with SMTP id z26mr30729573qvc.65.1565633825579; Mon, 12 Aug 2019 11:17:05 -0700 (PDT) In-Reply-To: <20190812171851.GS9017@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:14557 Archived-At: On Mon, Aug 12, 2019 at 10:19 AM Rich Felker wrote: > > On Mon, Aug 12, 2019 at 05:55:28PM +0100, Jorge Almeida wrote: > > On Mon, Aug 12, 2019 at 5:48 PM Jorge Almeida wro= te: > > > > > > > > with gcc-8.3.0 on x86_64. Could someone check the following hello.c > > > and see what size you get? > > > I get 16768 bytes (not stripped) and 12324 (stripped). > > > Note that I'm not even using printf. > > > > > > Thanks > > > > > > #include > > > int main(int argc, char* argv[]){ > > > write(1, "Hello, bloated world...\n", 24); > > > } > > > > Sorry, I forgot to add the compile options. In attachement, due to > > Gmail interface being what it is. > > > gcc -static -Os -march=3Dnative -fomit-frame-pointer -pipe -Wall -Werr= or=3Dpedantic -Werror=3Dimplicit-function-declaration -pedantic -pedantic-= errors -mpreferred-stack-boundary=3D4 -falign-functions=3D1 -falign-jumps= =3D1 -falign-loops=3D1 -fno-unwind-tables -fdata-sections -ffunction-sectio= ns -Wl,--gc-sections -fno-asynchronous-unwind-tables -fstrict-aliasing -Wst= rict-aliasing=3D2 -Wno-unused-function -std=3Dc11 hello.c > > > > Stripping: > > > > strip -s a.out > > strip -S --strip-unneeded --remove-section=3D.note.gnu.gold-version --r= emove-section=3D.comment --remove-section=3D.note --remove-section=3D.note.= gnu.build-id --remove-section=3D.note.ABI-tag --remove-section=3D.eh_frame = --remove-section=3D.eh_frame_ptr -R .note -R .comment -R .note.GNU-stack a.= out > > sstrip a.out > > This is a binutils regression from a dubious anti-ROP feature, -z > separate-code. Add -Wl,-z,noseparate-code and it will go away. > is this still so with latest release as well. > FYI musl-cross-make has been updated to change the default back in > toolchains it builds. > > Rich