OSDN Git Service

* decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
[pf3gnuchains/gcc-fork.git] / gcc / ada / mlib-tgt-specific-vms-alpha.adb
index 2912936..c9ffa0d 100644 (file)
@@ -46,7 +46,7 @@ with System.CRTL;      use System.CRTL;
 
 package body MLib.Tgt.Specific is
 
-   --  Non default subprogram. See comment in mlib-tgt.ads.
+   --  Non default subprogram. See comment in mlib-tgt.ads
 
    procedure Build_Dynamic_Library
      (Ofiles       : Argument_List;
@@ -196,8 +196,9 @@ package body MLib.Tgt.Specific is
 
             exception
                when Constraint_Error =>
-                  Fail ("illegal version """, Lib_Version,
-                        """ (on VMS version must be a positive number)");
+                  Fail ("illegal version """
+                        & Lib_Version
+                        & """ (on VMS version must be a positive number)");
                   return "";
             end;
          end if;
@@ -239,7 +240,7 @@ package body MLib.Tgt.Specific is
          Gnatsym_Path := Locate_Exec_On_Path (Gnatsym_Name);
 
          if Gnatsym_Path = null then
-            Fail (Gnatsym_Name, " not found in path");
+            Fail (Gnatsym_Name & " not found in path");
          end if;
       end if;
 
@@ -276,12 +277,26 @@ package body MLib.Tgt.Specific is
             --  Create and write the auto-init assembly file
 
             declare
-               First_Line : constant String :=
-                              ASCII.HT & ".section LIB$INITIALIZE,GBL,NOWRT" &
-               ASCII.LF;
-               Second_Line : constant String :=
-                               ASCII.HT & ".long " & Init_Proc & ASCII.LF;
-               --  First and second lines of the auto-init assembly file
+               use ASCII;
+
+               --  Output a dummy transfer address for debugging
+               --  followed by the LIB$INITIALIZE section.
+
+               Lines : constant String :=
+                 HT & ".text" & LF &
+                 HT & ".align 4" & LF &
+                 HT & ".globl __main" & LF &
+                 HT & ".ent __main" & LF &
+                 "__main..en:" & LF &
+                 HT & ".base $27" & LF &
+                 HT & ".frame $29,0,$26,8" & LF &
+                 HT & "ret $31,($26),1" & LF &
+                 HT & ".link" & LF &
+                 "__main:" & LF &
+                 HT & ".pdesc __main..en,null" & LF &
+                 HT & ".end __main" & LF & LF &
+                 HT & ".section LIB$INITIALIZE,GBL,NOWRT" & LF &
+                 HT & ".long " & Init_Proc & LF;
 
             begin
                Macro_File := Create_File (Macro_File_Name, Text);
@@ -289,16 +304,9 @@ package body MLib.Tgt.Specific is
 
                if OK then
                   Len := Write
-                    (Macro_File, First_Line (First_Line'First)'Address,
-                     First_Line'Length);
-                  OK := Len = First_Line'Length;
-               end if;
-
-               if OK then
-                  Len := Write
-                    (Macro_File, Second_Line (Second_Line'First)'Address,
-                     Second_Line'Length);
-                  OK := Len = Second_Line'Length;
+                    (Macro_File, Lines (Lines'First)'Address,
+                     Lines'Length);
+                  OK := Len = Lines'Length;
                end if;
 
                if OK then
@@ -306,8 +314,9 @@ package body MLib.Tgt.Specific is
                end if;
 
                if not OK then
-                  Fail ("creation of auto-init assembly file """,
-                        Macro_File_Name, """ failed");
+                  Fail ("creation of auto-init assembly file """
+                        & Macro_File_Name
+                        & """ failed");
                end if;
             end;
 
@@ -323,8 +332,9 @@ package body MLib.Tgt.Specific is
                                    mode (mode'First)'Address);
 
             if Popen_Result = Null_Address then
-               Fail ("assembly of auto-init assembly file """,
-                     Macro_File_Name, """ failed");
+               Fail ("assembly of auto-init assembly file """
+                     & Macro_File_Name
+                     & """ failed");
             end if;
 
             --  Wait for the end of execution of the macro-assembler
@@ -332,8 +342,9 @@ package body MLib.Tgt.Specific is
             Pclose_Result := pclose (Popen_Result);
 
             if Pclose_Result < 0 then
-               Fail ("assembly of auto init assembly file """,
-                     Macro_File_Name, """ failed");
+               Fail ("assembly of auto init assembly file """
+                     & Macro_File_Name
+                     & """ failed");
             end if;
 
             --  Add the generated object file to the list of objects to be
@@ -425,8 +436,9 @@ package body MLib.Tgt.Specific is
              Success      => Success);
 
       if not Success then
-         Fail ("unable to create symbol file for library """,
-               Lib_Filename, """");
+         Fail ("unable to create symbol file for library """
+               & Lib_Filename
+               & """");
       end if;
 
       Free (Arguments);