Jelajahi Sumber

* general-dynamic -> global-dynamic

git-svn-id: trunk@43132 -
florian 5 tahun lalu
induk
melakukan
a2d3522812

+ 1 - 1
Makefile

@@ -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)

+ 1 - 1
Makefile.fpc

@@ -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
 
 

+ 5 - 1
compiler/arm/aoptcpu.pas

@@ -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

+ 1 - 1
compiler/arm/narmld.pas

@@ -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);

+ 1 - 1
compiler/globtype.pas

@@ -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,

+ 1 - 1
compiler/i386/cpupi.pas

@@ -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

+ 3 - 3
compiler/options.pas

@@ -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
-                          init_settings.tlsmodel:=tlsm_general_dynamic
+                        if s='GLOBAL-DYNAMIC' then
+                          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;

+ 2 - 2
compiler/x86/nx86ld.pas

@@ -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,[]);