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.
This commit is contained in:
Pierre Muller 2023-10-31 15:49:23 +00:00
parent 78368d4432
commit 2cbaa24f76
4 changed files with 395 additions and 376 deletions

View File

@ -3185,7 +3185,7 @@ execinfo_x_stackcommit=09134_X_Stack space committed: $1 bytes
#
# Internal linker messages
#
# 09222 is the last used one
# 09223 is the last used one
#
# BeginOfTeX
% \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.
link_e_undefined_symbol=09222_E_Undefined symbol: $1
% 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}
# EndOfTeX

View File

@ -985,6 +985,7 @@ const
link_e_comdat_selection_differs=09220;
link_e_undefined_symbol_in_obj=09221;
link_e_undefined_symbol=09222;
link_e_unsupported_cross_endian_internal_linker=09223;
unit_t_unitsearch=10000;
unit_t_ppu_loading=10001;
unit_u_ppu_name=10002;
@ -1170,9 +1171,9 @@ const
option_info=11024;
option_help_pages=11025;
MsgTxtSize = 92222;
MsgTxtSize = 92299;
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
);

File diff suppressed because it is too large Load Diff

View File

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