Commit 7f612e89 by Pascal Obry Committed by Arnaud Charlet

mdll.adb (Build_Reloc_DLL): Fix parameter handling when a map file is used.

2005-11-14  Pascal Obry  <obry@adacore.com>

	* mdll.adb (Build_Reloc_DLL): Fix parameter handling when a map file is
	used.
	(Ada_Build_Reloc_DLL): Fix parameter handling when a map file is used.
	In both cases the last argument was dropped.

From-SVN: r106991
parent dd489fe6
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -154,18 +154,20 @@ package body MDLL is ...@@ -154,18 +154,20 @@ package body MDLL is
-- 5) Build the dynamic library -- 5) Build the dynamic library
declare declare
Params : OS_Lib.Argument_List := Params : constant OS_Lib.Argument_List :=
Map_Opt'Unchecked_Access &
Adr_Opt'Unchecked_Access & All_Options; Adr_Opt'Unchecked_Access & All_Options;
First_Param : Positive := Params'First + 1;
begin begin
if Map_File then if Map_File then
Params := Map_Opt'Unchecked_Access & Params; First_Param := Params'First;
end if; end if;
Utl.Gcc Utl.Gcc
(Output_File => Dll_File, (Output_File => Dll_File,
Files => Objects_Exp_File, Files => Objects_Exp_File,
Options => Params, Options => Params (First_Param .. Params'Last),
Build_Lib => True); Build_Lib => True);
end; end;
...@@ -252,7 +254,8 @@ package body MDLL is ...@@ -252,7 +254,8 @@ package body MDLL is
Utl.Gnatbind (L_Afiles, Options & Bargs_Options); Utl.Gnatbind (L_Afiles, Options & Bargs_Options);
declare declare
Params : OS_Lib.Argument_List := Params : constant OS_Lib.Argument_List :=
Map_Opt'Unchecked_Access &
Out_Opt'Unchecked_Access & Out_Opt'Unchecked_Access &
Dll_File'Unchecked_Access & Dll_File'Unchecked_Access &
Lib_Opt'Unchecked_Access & Lib_Opt'Unchecked_Access &
...@@ -260,12 +263,16 @@ package body MDLL is ...@@ -260,12 +263,16 @@ package body MDLL is
Adr_Opt'Unchecked_Access & Adr_Opt'Unchecked_Access &
Ofiles & Ofiles &
All_Options; All_Options;
First_Param : Positive := Params'First + 1;
begin begin
if Map_File then if Map_File then
Params := Map_Opt'Unchecked_Access & Params; First_Param := Params'First;
end if; end if;
Utl.Gnatlink (L_Afiles (L_Afiles'Last).all, Params); Utl.Gnatlink
(L_Afiles (L_Afiles'Last).all,
Params (First_Param .. Params'Last));
end; end;
OS_Lib.Delete_File (Exp_File, Success); OS_Lib.Delete_File (Exp_File, Success);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment