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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fcc2d88d867060e8,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-18 15:32:04 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!c03.atl99!news.webusenet.com!diablo.voicenet.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr23.news.prodigy.com.POSTED!7db1df25!not-for-mail From: lifetime n00b User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031014 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: load and use a ".o" file? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 216.63.104.87 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr23.news.prodigy.com 1071790289 ST000 216.63.104.87 (Thu, 18 Dec 2003 18:31:29 EST) NNTP-Posting-Date: Thu, 18 Dec 2003 18:31:29 EST Organization: SBC http://yahoo.sbc.com X-UserInfo1: FKPO@SZDWJTGRQHX@BCBNWX@RJ_XPDLMN@GZ_GYO^BSZUSAANVUEAE[YETZPIWWI[FCIZA^NBFXZ_D[BFNTCNVPDTNTKHWXKB@X^B_OCJLPZ@ET_O[G\XSG@E\G[ZKVLBL^CJINM@I_KVIOR\T_M_AW_M[_BWU_HFA_]@A_A^SGFAUDE_DFTMQPFWVW[QPJN Date: Thu, 18 Dec 2003 23:31:29 GMT Xref: archiver1.google.com comp.lang.ada:3542 Date: 2003-12-18T23:31:29+00:00 List-Id: I've been trying to educate myself on how to do this, but I can't seem to find the answers I need. In concept, what I need to be able to do seems like it should be simple, and so I'll give a simple example. There is a main program loop already running, and there is a ".o" compiled object file (compiled with gnat) which *hasn't* been linked into the main program, but it has a procedure or function in it I want to call. Let's say it is very simple function which was compiled from this: function HiThere return String is begin return "Hi there!"; end HiThere; Instead of linking this into an executable, it is just compiled with say, "gnatmake -c hithere", to get the "hithere.o" file we're interested in. Now, how can I load this "hithere.o" file into an already running program (without linking it in beforehand) and then call the "HiThere" function from that program (which was also written in Ada)? Would the information in the corresponding .ali file be of use? Maybe I'm thinking about it wrong, and the source which compiles to the object file needs to have some access types or some other mechanisms in place? Note that I'm not talking about using a .dll or .so file, just the .o file. Any guidance would be appreciated.