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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:ae9:d847:: with SMTP id u68mr13468629qkf.322.1587340393352; Sun, 19 Apr 2020 16:53:13 -0700 (PDT) X-Received: by 2002:a9d:1a3:: with SMTP id e32mr7796004ote.206.1587340393063; Sun, 19 Apr 2020 16:53:13 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 19 Apr 2020 16:53:12 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: How to emulate multiple exports From: Jere Injection-Date: Sun, 19 Apr 2020 23:53:13 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58424 Date: 2020-04-19T16:53:12-07:00 List-Id: I am working in a space constrained environment (256k flash) and I want to try and reuse the same exported function for all of my unused interrupt handlers. procedure Default; procedure Default is begin -- Do some complex stuff; end Default; Each unused interrupt handler looks for a unique/specific external symbol name. However, the Export aspect/pragma can only be specified once for Default. I've tried a few different solutions but all of them are not really desirable. 1. Tried doing renames of Default. Doesn't work as the compiler is smart enough to figure this out and complain that I have multiple exports. 2. Using a generic Default function and instantiating a separate copy for each unused handler. This lets me give each an export and the code inside Default, but a separate copy of Default is created for each handler causing a severe loss of ROM space. 3. Calling Default inside a wrapper procedure. This is better than option #2, but still takes up a lot of lost ROM space (multiple copies of the wrapper function essentially). In C and C++ I was able to leverage the alias attribute to do this, but I have been unsuccessful in getting the analogous Linker_Alias pragma to work (it just ignores Default altogether). So is there any way to do this? Or am I just stuck with all the code bloat? I'm working with the GNAT 2019 CE cross compiler for ARM on Windows 10.