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-Thread: 103376,b9edf26d62bf8739 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.223.40 with SMTP id qr8mr9803673pbc.0.1338305912718; Tue, 29 May 2012 08:38:32 -0700 (PDT) Path: pr3ni62706pbb.0!nntp.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: "duplicated external tag" Date: Tue, 29 May 2012 16:38:31 +0100 Organization: A noiseless patient Spider Message-ID: References: <8f40f59a-0086-4065-a984-6c834114f69e@3g2000vbx.googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="IlSPLpZ1axUqMIpgfl65wA"; logging-data="1024"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+X35+2mmSjrbnkGrtCQAF3j1vc6iq+SEk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (darwin) Cancel-Lock: sha1:ZQfJEFGzf/WtD+IiuTcsZO5v0m4= sha1:Ve2icIU1tOLptio5SdSBtlBddeE= Content-Type: text/plain; charset=us-ascii Date: 2012-05-29T16:38:31+01:00 List-Id: Anders Jansson writes: > I have a application that explicitly loads other Ada-Dll's (built as > relocatables with GPR files and gprbuild) in GNAT 6.5.0. Given that version of GNAT, I'd have thought you could get an answer from AdaCore? > When I try to load the same Dll the second time, Ada Elab generates > exception "Program Error" with message "duplicated external tag"! > I have tried to move all "tagged" types away from the visible/exported > side of the Dll's, so it just have the entry points needed. I use > a .def file to limit the visible entry points. > And these entry points are only 5 procedures/functions! > So here's the question! > Is there any way to supress the elaboration checks on "tagged" types, > so that I can load as many Dll's as needed? > Or can this be done in anyother way? >From a position of some ignorance, I would have thought you should put the offending tagged types into DLLs of their own, so that each DLL only gets loaded once. In GCC 4.7.0, a-tags.adb has the comment -- Verify that the external tag of this TSD is not registered in -- the runtime hash table. (TSD is "type-specific data"), and I guess the "runtime hash table" is in the Ada RTS and shared by all DLLs, hence your problem. debug.adb says that the compiler flag -gnatdQ suppresses the runtime check.