From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.225.7 with SMTP id rg7mr31934097igc.5.1419704746849; Sat, 27 Dec 2014 10:25:46 -0800 (PST) X-Received: by 10.140.96.85 with SMTP id j79mr846082qge.2.1419704746715; Sat, 27 Dec 2014 10:25:46 -0800 (PST) Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!h15no31310001igd.0!news-out.google.com!n9ni75qai.0!nntp.google.com!bm13no1428977qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 27 Dec 2014 10:25:46 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=90.229.166.210; posting-account=yz2tywoAAABGMYjDvPrnwB-gG84yE0F3 NNTP-Posting-Host: 90.229.166.210 References: <7f38a07d-3f73-432c-8647-e3a7dcf43637@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Size of linked program increasing with new version of GNAT. From: Tony Injection-Date: Sat, 27 Dec 2014 18:25:46 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:191552 Date: 2014-12-27T10:25:46-08:00 List-Id: On Saturday, December 27, 2014 7:43:14 AM UTC+1, Simon Wright wrote: > A main program with a null body, compiled with -O2 and stripped, > resulted in executable size 83540; I'd expect that program to be compiled into a single machine code return instruction. I managed to create a 12 KB version of Hello-World, by excluding runtime and Ada.Text_Io and calling Win32 functions directly: pragma No_Run_Time; with System; procedure Hello is function Writeconsole (Hconsoleoutput : Integer; Lpbuffer : System.Address; Nnumberofcharstowrite : Integer; Lpnumberofcharswritten : Integer; Lpreserved : Integer) return Integer; pragma Import (Stdcall, Writeconsole, "WriteConsoleA"); function Getstdhandle (Nstdhandle : Integer) return Integer; pragma Import (Stdcall, Getstdhandle, "GetStdHandle"); Std_Output_Handle : constant := -11; S : constant String := "Hello, World!" & Ascii.Lf; Dummy : Integer; begin Dummy := Writeconsole(Getstdhandle(Std_Output_Handle), S'Address, S'Length, 0, 0); end;