------- Comment #4 from oliver dot kellogg at eads dot com 2009-03-04 17:45 ------- Created an attachment (id=17394) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17394&action=view) rough fix (patch to s-finimp.adb)
Further investigation shows that Ada.Text_Io.Elab_{Spec,Body} is called by both adasharedlibinit (shared library) and adainit (main program.) The patch makes sure that multiple calls to System.Finalization_Implementation.Attach_To_Final_List with the same Obj parameter insert the Obj only once in the Global_Final_List. It may very well not be the Right Way (TM) to fix the problem, though. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38832