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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,65131be031e94e02 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-19 04:49:24 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!newsgate.cistron.nl!isdnet!grolier!news.mat.cc!fr.clara.net!heighliner.fr.clara.net!telocity-west!TELOCITY!newsrump.sjc.telocity.net!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada References: <01c0b063$c08079b0$668e4991@pc1944> Subject: Re: newbie: Problem with calling functions in shared library MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: X-Trace: M/Agjm9BdXRoVXNltiBURUxPQ0lUWS2WRUFERVKXIDL1Ni4yMjcuNPMuNDkgIE1vbiwg9TkgTWGy!IDIwMDEgMDT+NPg6NDYgUFNU X-Abuse-Info: Please forward ALL headers when reporting abuse. X-Complaints-To: abuse@telocity.net NNTP-Posting-Date: Mon, 19 Mar 2001 04:48:46 PST Date: Mon, 19 Mar 2001 06:48:53 -0600 Xref: supernews.google.com comp.lang.ada:5838 Date: 2001-03-19T06:48:53-06:00 List-Id: This sounds like there is elaboration code in the Ada shared library unit that is not getting called before the subprograms in the library. There may be a symbol like ____elabb and/or ____elabs, that need to be called before calling any of the subprograms in the library. "Fokker Space" wrote in message news:01c0b063$c08079b0$668e4991@pc1944... > I have a question regarding Ada and libraries with the use of GNAT. We have > the following situation under operating system IRIX: > > 1) Ada source without main routine -> compile with gnatmake or gcc -> Get a > .o file > 2) Link the .o file to a shared library .so with the use of > gnatlink > 3) An exe (from a C-source) loads the shared library with the > dlopen-function. > 4) The exe determines the places of procedures and functions in the shared > library with the dlsym-function and calls them. > > The problem is that I keep getting crashes when calling the functions in > the shared library. When I compile the same Ada source with the C-source > into a seperate exe the problem doesn't occur. I suspect I am compiling or > linking the shared library with the wrong flags or something like that. > > Does anybody know what to do it this situation or (even better) have a > small example of a working program? > > Bart Schipperijn