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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bill Findlay Newsgroups: comp.lang.ada Subject: Re: Ada interacting with Windows 8.1+ GUI Date: Fri, 26 Oct 2018 22:19:35 +0100 Message-ID: <0001HW.2183BC6700CD95497000073D52EF@news.individual.net> References: <5fb88cf6-47da-4c28-a660-9ddf06522b12@googlegroups.com> <5b897611-5e95-4bc8-b5b9-a8df97299cd6@googlegroups.com> <61c2515d-29fd-4b96-8138-88d7f5419fb5@googlegroups.com> <0001HW.218345810081A9777000053542EF@news.individual.net> Reply-To: findlaybill@blueyonder.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net qpmFMCmF45FA5W0toYKmdws/xuNcaXbdjn20MQnnUSO3x9+OnD X-Orig-Path: not-for-mail Cancel-Lock: sha1:/o85zi1+BVIW7MW88v8KEfWyp7E= User-Agent: Hogwasher/5.19 Xref: reader02.eternal-september.org comp.lang.ada:54719 Date: 2018-10-26T22:19:35+01:00 List-Id: On 26 Oct 2018, Simon Wright wrote (in article ): > Bill Findlay writes: > > > On 26 Oct 2018, Simon Wright wrote > > (in article ): > > > > > joakimds@kth.se writes: > > > > > > > Isn't it easy for the compiler to optimize away/remove the code that > > > > is not used? > > > > > > Not so much in a library package where some subprograms don't have to be > > > used by the overall program. > > > > > > You can compile with -ffunction-sections -fdata-sections which say each > > > subprogram/data object resp. is to have its own section. If your linker > > > supports (the equivalent of) -gc-sections. linking with it means that > > > only the used sections get linked. This is fine for (arm-eabi) embedded > > > systems & (probably) Linux. which use GNU ld, but not on macOS. Can't > > > say for Windows. > > > > > > GNAT provides gnatelim, which analyses your code and (?) regenerates it > > > without the unused objects. No idea how well this works. > > > > Does : > > > > -Wl,-dead_strip -Wl,-dead_strip > > > > not work on macOS instead of: > > I don't think you have to say it twice! - but, yes, thanks I was under the impression you had to say it separately for data-sections and function-sections, but I could easily be wrong. -- Bill Findlay