2
0
Эх сурвалжийг харах

Prevent usage of internal linker in cross-endian configuration.

Add LinkInternSetExplicitly field to TOption class.
Set this field to true if '-Xe-' or '-Xi' option is used.
Check at exit if in cross-endian configuration:
 if LinkInternSetExplicitly is set, issue error message,
else add cs_link_extern to init_settings.globalswitches.
Pierre Muller 1 жил өмнө
parent
commit
2cbaa24f76

+ 3 - 1
compiler/msg/errore.msg

@@ -3185,7 +3185,7 @@ execinfo_x_stackcommit=09134_X_Stack space committed: $1 bytes
 #
 #
 # Internal linker messages
 # Internal linker messages
 #
 #
-# 09222 is the last used one
+# 09223 is the last used one
 #
 #
 # BeginOfTeX
 # BeginOfTeX
 % \section{Linker messages}
 % \section{Linker messages}
@@ -3250,6 +3250,8 @@ link_e_undefined_symbol_in_obj=09221_E_Undefined symbol: $1 (first seen in $2)
 % The specified symbol is used, but not defined and was first seen in the specified object file.
 % The specified symbol is used, but not defined and was first seen in the specified object file.
 link_e_undefined_symbol=09222_E_Undefined symbol: $1
 link_e_undefined_symbol=09222_E_Undefined symbol: $1
 % The specified symbol is used, but not defined.
 % The specified symbol is used, but not defined.
+link_e_unsupported_cross_endian_internal_linker=09223_E_Using internal linker in cross-endian configuration is not supported
+% The internal linker does not correctly handle endianess conversion.
 % \end{description}
 % \end{description}
 # EndOfTeX
 # EndOfTeX
 
 

+ 3 - 2
compiler/msgidx.inc

@@ -985,6 +985,7 @@ const
   link_e_comdat_selection_differs=09220;
   link_e_comdat_selection_differs=09220;
   link_e_undefined_symbol_in_obj=09221;
   link_e_undefined_symbol_in_obj=09221;
   link_e_undefined_symbol=09222;
   link_e_undefined_symbol=09222;
+  link_e_unsupported_cross_endian_internal_linker=09223;
   unit_t_unitsearch=10000;
   unit_t_unitsearch=10000;
   unit_t_ppu_loading=10001;
   unit_t_ppu_loading=10001;
   unit_u_ppu_name=10002;
   unit_u_ppu_name=10002;
@@ -1170,9 +1171,9 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 92222;
+  MsgTxtSize = 92299;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
-    29,109,371,134,102,63,148,38,223,71,
+    29,109,371,134,102,63,148,38,224,71,
     68,20,30,1,1,1,1,1,1,1
     68,20,30,1,1,1,1,1,1,1
   );
   );

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 295 - 293
compiler/msgtxt.inc


+ 16 - 2
compiler/options.pas

@@ -38,6 +38,7 @@ Type
     LogoWritten,
     LogoWritten,
     ABISetExplicitly,
     ABISetExplicitly,
     FPUSetExplicitly,
     FPUSetExplicitly,
+    LinkInternSetExplicitly,
     CPUSetExplicitly,
     CPUSetExplicitly,
     OptCPUSetExplicitly: boolean;
     OptCPUSetExplicitly: boolean;
     FileLevel : longint;
     FileLevel : longint;
@@ -4179,7 +4180,10 @@ begin
        'e' :
        'e' :
          begin
          begin
            If UnsetBool(More, j, opt, false) then
            If UnsetBool(More, j, opt, false) then
-             exclude(init_settings.globalswitches,cs_link_extern)
+             begin
+               exclude(init_settings.globalswitches,cs_link_extern);
+               LinkInternSetExplicitly:=true;
+             end
            else
            else
              include(init_settings.globalswitches,cs_link_extern);
              include(init_settings.globalswitches,cs_link_extern);
          end;
          end;
@@ -4197,7 +4201,10 @@ begin
            If UnsetBool(More, j, opt, false) then
            If UnsetBool(More, j, opt, false) then
              include(init_settings.globalswitches,cs_link_extern)
              include(init_settings.globalswitches,cs_link_extern)
            else
            else
-             exclude(init_settings.globalswitches,cs_link_extern);
+             begin
+               exclude(init_settings.globalswitches,cs_link_extern);
+               LinkInternSetExplicitly:=true;
+             end;
          end;
          end;
        'n' :
        'n' :
          begin
          begin
@@ -5692,6 +5699,13 @@ begin
 
 
   if not option.LinkTypeSetExplicitly then
   if not option.LinkTypeSetExplicitly then
     set_default_link_type;
     set_default_link_type;
+  if source_info.endian<>target_info.endian then
+    begin
+      if option.LinkInternSetExplicitly then
+        Message(link_e_unsupported_cross_endian_internal_linker)
+      else
+        include(init_settings.globalswitches,cs_link_extern);
+    end;
 
 
   { Default alignment settings,
   { Default alignment settings,
     1. load the defaults for the target
     1. load the defaults for the target

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно