===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -47,6 +47,11 @@
with System.Tasking.Debug;
with System.Parameters;
+with System.Secondary_Stack; pragma Elaborate_All (System.Secondary_Stack);
+pragma Unreferenced (System.Secondary_Stack);
+-- Make sure the body of Secondary_Stack is elaborated before calling
+-- Init_Tasking_Soft_Links.
+
package body System.Tasking.Initialization is
package STPO renames System.Task_Primitives.Operations;
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 1999-2014, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -47,9 +47,12 @@
with System.Task_Primitives.Operations;
with System.Soft_Links.Tasking;
-with System.Secondary_Stack;
with System.Storage_Elements;
+with System.Secondary_Stack; pragma Elaborate_All (System.Secondary_Stack);
+-- Make sure the body of Secondary_Stack is elaborated before calling
+-- Init_Tasking_Soft_Links.
+
with System.Soft_Links;
-- Used for the non-tasking routines (*_NT) that refer to global data. They
-- are needed here before the tasking run time has been elaborated. used for
===================================================================
@@ -7,7 +7,7 @@
-- B o d y --
-- --
-- Copyright (C) 1991-1994, Florida State University --
+-- Copyright (C) 1995-2014, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,6 +38,10 @@
with System.Parameters;
with System.Traces;
with System.Soft_Links.Tasking;
+with System.Secondary_Stack; pragma Elaborate_All (System.Secondary_Stack);
+pragma Unreferenced (System.Secondary_Stack);
+-- Make sure the body of Secondary_Stack is elaborated before calling
+-- Init_Tasking_Soft_Links.
package body System.Tasking.Protected_Objects is
===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 2004-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -95,7 +95,11 @@
function Get_Sec_Stack_Addr return Address is
begin
- return STPO.Self.Common.Compiler_Data.Sec_Stack_Addr;
+ return Result : constant Address :=
+ STPO.Self.Common.Compiler_Data.Sec_Stack_Addr
+ do
+ pragma Assert (Result /= Null_Address);
+ end return;
end Get_Sec_Stack_Addr;
function Get_Stack_Info return Stack_Checking.Stack_Access is
@@ -222,6 +226,8 @@
SSL.Set_Sec_Stack_Addr (SSL.Get_Sec_Stack_Addr_NT);
SSL.Set_Jmpbuf_Address (SSL.Get_Jmpbuf_Address_NT);
end if;
+
+ pragma Assert (Get_Sec_Stack_Addr /= Null_Address);
end Init_Tasking_Soft_Links;
end System.Soft_Links.Tasking;
===================================================================
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
+-- Copyright (C) 2009-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,6 +38,7 @@
procedure Init_Tasking_Soft_Links;
-- Set the tasking soft links that are common to the full and the
- -- restricted run times.
+ -- restricted run times. Clients need to make sure the body of
+ -- System.Secondary_Stack is elaborated before calling this.
end System.Soft_Links.Tasking;