* general-dynamic -> global-dynamic

git-svn-id: trunk@43132 -
This commit is contained in:
florian 2019-10-05 20:48:29 +00:00
parent 7ee889d4ec
commit a2d3522812
8 changed files with 15 additions and 11 deletions

View File

@ -472,7 +472,7 @@ OPTNEW+=$(OPT)
endif endif
ifneq ($(findstring $(OS_TARGET),linux),) ifneq ($(findstring $(OS_TARGET),linux),)
ifneq ($(findstring $(CPU_TARGET),i386 arm),) ifneq ($(findstring $(CPU_TARGET),i386 arm),)
override OPTNEW+=-CVgeneral-dynamic override OPTNEW+=-CVglobal-dynamic
endif endif
endif endif
CLEANOPTS=FPC=$(PPNEW) CLEANOPTS=FPC=$(PPNEW)

View File

@ -202,7 +202,7 @@ endif
# the general threading model when compiling the final versions of rtl and packages # the general threading model when compiling the final versions of rtl and packages
ifneq ($(findstring $(OS_TARGET),linux),) ifneq ($(findstring $(OS_TARGET),linux),)
ifneq ($(findstring $(CPU_TARGET),i386 arm),) ifneq ($(findstring $(CPU_TARGET),i386 arm),)
override OPTNEW+=-CVgeneral-dynamic override OPTNEW+=-CVglobal-dynamic
endif endif
endif endif

View File

@ -2657,7 +2657,11 @@ Implementation
) and ) and
GetNextInstruction(hp1,hp2) and GetNextInstruction(hp1,hp2) and
(hp2.typ=ait_instruction) and (hp2.typ=ait_instruction) and
{ loaded register used by next instruction? } { loaded register used by next instruction?
if we ever support labels (they could be skipped in theory) here, the gnu2 tls general-dynamic code could get broken (the ldr before
the bl may not be scheduled away from the bl) and it needs to be taken care of this case
}
(RegInInstruction(taicpu(hp1).oper[0]^.reg,hp2)) and (RegInInstruction(taicpu(hp1).oper[0]^.reg,hp2)) and
{ loaded register not used by previous instruction? } { loaded register not used by previous instruction? }
not(RegInInstruction(taicpu(hp1).oper[0]^.reg,p)) and not(RegInInstruction(taicpu(hp1).oper[0]^.reg,p)) and

View File

@ -68,7 +68,7 @@ implementation
if not(pi_uses_threadvar in current_procinfo.flags) then if not(pi_uses_threadvar in current_procinfo.flags) then
internalerror(2012012101); internalerror(2012012101);
case current_settings.tlsmodel of case current_settings.tlsmodel of
tlsm_general_dynamic: tlsm_global_dynamic:
begin begin
{$ifdef use_tls_dialect_gnu} {$ifdef use_tls_dialect_gnu}
current_asmdata.getjumplabel(l); current_asmdata.getjumplabel(l);

View File

@ -752,7 +752,7 @@ interface
ttlsmodel = (tlsm_none, ttlsmodel = (tlsm_none,
{ elf tls model: works for all kind of code and thread vars } { elf tls model: works for all kind of code and thread vars }
tlsm_general_dynamic, tlsm_global_dynamic,
{ elf tls model: works only if the thread vars are declared and used in the same module, { elf tls model: works only if the thread vars are declared and used in the same module,
regardless when the module is loaded } regardless when the module is loaded }
tlsm_local_dynamic, tlsm_local_dynamic,

View File

@ -98,7 +98,7 @@ unit cpupi;
procedure tcpuprocinfo.allocate_got_register(list: tasmlist); procedure tcpuprocinfo.allocate_got_register(list: tasmlist);
begin begin
if (pi_uses_threadvar in flags) and (tf_section_threadvars in target_info.flags) and (current_settings.tlsmodel in [tlsm_general_dynamic]) then if (pi_uses_threadvar in flags) and (tf_section_threadvars in target_info.flags) and (current_settings.tlsmodel in [tlsm_global_dynamic]) then
begin begin
{ FIXME: It is better to use an imaginary register for GOT and { FIXME: It is better to use an imaginary register for GOT and
if EBX is needed for some reason just allocate EBX and if EBX is needed for some reason just allocate EBX and

View File

@ -1485,8 +1485,8 @@ begin
'V': 'V':
begin begin
s:=upper(copy(more,j+1,length(more)-j)); s:=upper(copy(more,j+1,length(more)-j));
if s='GENERAL-DYNAMIC' then if s='GLOBAL-DYNAMIC' then
init_settings.tlsmodel:=tlsm_general_dynamic init_settings.tlsmodel:=tlsm_global_dynamic
else if s='LOCAL-EXEC' then else if s='LOCAL-EXEC' then
init_settings.tlsmodel:=tlsm_local_exec init_settings.tlsmodel:=tlsm_local_exec
else else
@ -4155,7 +4155,7 @@ begin
if (tf_section_threadvars in target_info.flags) and (init_settings.tlsmodel=tlsm_none) then if (tf_section_threadvars in target_info.flags) and (init_settings.tlsmodel=tlsm_none) then
begin begin
if cs_create_pic in init_settings.moduleswitches then if cs_create_pic in init_settings.moduleswitches then
init_settings.tlsmodel:=tlsm_general_dynamic init_settings.tlsmodel:=tlsm_global_dynamic
else else
init_settings.tlsmodel:=tlsm_local_exec; init_settings.tlsmodel:=tlsm_local_exec;
end; end;

View File

@ -98,7 +98,7 @@ implementation
location.reference.segment:=NR_GS; location.reference.segment:=NR_GS;
location.reference.refaddr:=addr_ntpoff; location.reference.refaddr:=addr_ntpoff;
end; end;
tlsm_general_dynamic: tlsm_global_dynamic:
begin begin
include(current_procinfo.flags,pi_needs_got); include(current_procinfo.flags,pi_needs_got);
reference_reset(href,0,[]); reference_reset(href,0,[]);
@ -132,7 +132,7 @@ implementation
location.reference.segment:=NR_FS; location.reference.segment:=NR_FS;
location.reference.refaddr:=addr_tpoff; location.reference.refaddr:=addr_tpoff;
end; end;
tlsm_general_dynamic: tlsm_global_dynamic:
begin begin
current_asmdata.CurrAsmList.concat(tai_const.Create_8bit($66)); current_asmdata.CurrAsmList.concat(tai_const.Create_8bit($66));
reference_reset(href,0,[]); reference_reset(href,0,[]);