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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.172.66 with SMTP id k2mr11321750qaz.4.1372689310293; Mon, 01 Jul 2013 07:35:10 -0700 (PDT) X-Received: by 10.49.71.173 with SMTP id w13mr705990qeu.21.1372689310281; Mon, 01 Jul 2013 07:35:10 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!j2no3174135qak.0!news-out.google.com!f7ni121qai.0!nntp.google.com!j2no3174128qak.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 1 Jul 2013 07:35:10 -0700 (PDT) In-Reply-To: <70b1d2b0-d5ab-431e-84b9-9f00af08dbe2@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=189.77.226.1; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu NNTP-Posting-Host: 189.77.226.1 References: <9cbe0ad4-f54c-4c99-ba58-4db027ae962e@googlegroups.com> <70b1d2b0-d5ab-431e-84b9-9f00af08dbe2@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Size optimization for objects From: "Rego, P." Injection-Date: Mon, 01 Jul 2013 14:35:10 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 2834 Xref: number.nntp.dca.giganews.com comp.lang.ada:182183 Date: 2013-07-01T07:35:10-07:00 List-Id: Hello Rolf, On Sunday, June 30, 2013 8:34:30 AM UTC-3, rrr.e...@gmail.com wrote: > strip(1) reduces the size of an application in the file system by removin= g the debug info. So it's not the best option, because I am trying to reduce the application = size in order to be able to debug the app. A new added code caused the app = to grow beyond I expected, so now I am not able to debug it anymore. I thin= k the best is to analyse using nm. But also probably there is more code (th= an the newest added one) I should optimize. =20 > If you want to see the size of various elements in a binary use nm(1). nm= --print-size --size-sort might give you some hints where to start remving = elements. I am still having some difficult in understand the information generated by= nm. It generates something like 00c038d6 ff42d001 D ___gl_locking_policy The first column I think it's the "symbol value", the second column I guess= it's the size of the symbol. The other columns are ok, since the man nm ex= plains quite well. What does "symbol value" mean?=20 Also, the second column represents the symbol size (in bytes I presume). If= I sum all the symbol sizes, should the total sum give the size of the exec= utable file? I tried this, but the total sum is far bigger than the real si= ze of the application binary. > If you compile with -fdata-sections -ffunction-sections and link with --g= c-sections the linker automatically removes all unused code and all unused = data. That is typically easier than gnatelim. I also will try this.=20 Thanks, Rego.