aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2025-01-10 18:56:55 +0100
committerMarc Poulhiès <dkm@gcc.gnu.org>2025-01-13 11:53:00 +0100
commit2e0b086f8403e00da964d44039c667d5b1806070 (patch)
treed68bbd8add97eb7a3a7811e1b3847927074d248c /gcc
parent492aae16856e10cc44606953287192e345ec3294 (diff)
downloadgcc-2e0b086f8403e00da964d44039c667d5b1806070.zip
gcc-2e0b086f8403e00da964d44039c667d5b1806070.tar.gz
gcc-2e0b086f8403e00da964d44039c667d5b1806070.tar.bz2
ada: Fix relocatable DLL creation with gnatdll
gcc/ada/ChangeLog: * mdll.adb: For the created DLL to be relocatable we do not want to use the base file name when calling gnatdll. * gnatdll.adb: Removes option -d which is not working anymore. And when using a truly relocatable DLL the base-address has no real meaning. Also reword the usage string for -d as we do not want to specify relocatable as gnatdll can be used to create both relocatable and non relocatable DLL.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/gnatdll.adb8
-rw-r--r--gcc/ada/mdll.adb13
2 files changed, 6 insertions, 15 deletions
diff --git a/gcc/ada/gnatdll.adb b/gcc/ada/gnatdll.adb
index 8881fc9..0faf79f 100644
--- a/gcc/ada/gnatdll.adb
+++ b/gcc/ada/gnatdll.adb
@@ -134,10 +134,8 @@ procedure Gnatdll is
P (" -l file File contains a list-of-files to be added to "
& "the library");
P (" -e file Definition file containing exports");
- P (" -d file Put objects in the relocatable dynamic "
+ P (" -d file Put objects in the dynamic "
& "library <file>");
- P (" -b addr Set base address for the relocatable DLL");
- P (" default address is " & Default_DLL_Address);
P (" -a[addr] Build non-relocatable DLL at address <addr>");
P (" if <addr> is not specified use "
& Default_DLL_Address);
@@ -315,10 +313,6 @@ procedure Gnatdll is
Must_Build_Relocatable := False;
- when 'b' =>
- DLL_Address := To_Unbounded_String (Parameter);
- Must_Build_Relocatable := True;
-
when 'e' =>
Def_Filename := To_Unbounded_String (Parameter);
diff --git a/gcc/ada/mdll.adb b/gcc/ada/mdll.adb
index 281f6a9..64350ff 100644
--- a/gcc/ada/mdll.adb
+++ b/gcc/ada/mdll.adb
@@ -77,10 +77,7 @@ package body MDLL is
Bas_Opt : aliased String := "-Wl,--base-file," & Bas_File;
Lib_Opt : aliased String := "-mdll";
Out_Opt : aliased String := "-o";
- Adr_Opt : aliased String :=
- (if Relocatable
- then ""
- else "-Wl,--image-base=" & Lib_Address);
+ Adr_Opt : aliased String := "-Wl,--image-base=" & Lib_Address;
Map_Opt : aliased String := "-Wl,-Map," & Lib_Filename & ".map";
L_Afiles : Argument_List := Afiles;
@@ -133,7 +130,7 @@ package body MDLL is
-- 2) Build exp from base file
Utl.Dlltool (Def_File, Dll_File, Lib_File,
- Base_File => Bas_File,
+ Base_File => (if Relocatable then "" else Bas_File),
Exp_Table => Exp_File,
Build_Import => False);
@@ -148,7 +145,7 @@ package body MDLL is
-- 4) Build new exp from base file and the lib file (.a)
Utl.Dlltool (Def_File, Dll_File, Lib_File,
- Base_File => Bas_File,
+ Base_File => (if Relocatable then "" else Bas_File),
Exp_Table => Exp_File,
Build_Import => Build_Import);
@@ -223,7 +220,7 @@ package body MDLL is
-- 2) Build exp from base file
Utl.Dlltool (Def_File, Dll_File, Lib_File,
- Base_File => Bas_File,
+ Base_File => (if Relocatable then "" else Bas_File),
Exp_Table => Exp_File,
Build_Import => False);
@@ -247,7 +244,7 @@ package body MDLL is
-- 4) Build new exp from base file and the lib file (.a)
Utl.Dlltool (Def_File, Dll_File, Lib_File,
- Base_File => Bas_File,
+ Base_File => (if Relocatable then "" else Bas_File),
Exp_Table => Exp_File,
Build_Import => Build_Import);