瀏覽代碼

* general-dynamic -> global-dynamic

git-svn-id: trunk@43132 -
florian 5 年之前
父節點
當前提交
a2d3522812
共有 8 個文件被更改,包括 15 次插入11 次删除
  1. 1 1
      Makefile
  2. 1 1
      Makefile.fpc
  3. 5 1
      compiler/arm/aoptcpu.pas
  4. 1 1
      compiler/arm/narmld.pas
  5. 1 1
      compiler/globtype.pas
  6. 1 1
      compiler/i386/cpupi.pas
  7. 3 3
      compiler/options.pas
  8. 2 2
      compiler/x86/nx86ld.pas

+ 1 - 1
Makefile

@@ -472,7 +472,7 @@ OPTNEW+=$(OPT)
 endif
 ifneq ($(findstring $(OS_TARGET),linux),)
 ifneq ($(findstring $(CPU_TARGET),i386 arm),)
-override OPTNEW+=-CVgeneral-dynamic
+override OPTNEW+=-CVglobal-dynamic
 endif
 endif
 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
 ifneq ($(findstring $(OS_TARGET),linux),)
 ifneq ($(findstring $(CPU_TARGET),i386 arm),)
-override OPTNEW+=-CVgeneral-dynamic
+override OPTNEW+=-CVglobal-dynamic
 endif
 endif
 

+ 5 - 1
compiler/arm/aoptcpu.pas

@@ -2657,7 +2657,11 @@ Implementation
             ) and
             GetNextInstruction(hp1,hp2) 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
             { loaded register not used by previous instruction? }
             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
                   internalerror(2012012101);
                 case current_settings.tlsmodel of
-                  tlsm_general_dynamic:
+                  tlsm_global_dynamic:
                     begin
 {$ifdef use_tls_dialect_gnu}
                       current_asmdata.getjumplabel(l);

+ 1 - 1
compiler/globtype.pas

@@ -752,7 +752,7 @@ interface
 
        ttlsmodel = (tlsm_none,
          { 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,
            regardless when the module is loaded }
          tlsm_local_dynamic,

+ 1 - 1
compiler/i386/cpupi.pas

@@ -98,7 +98,7 @@ unit cpupi;
 
     procedure tcpuprocinfo.allocate_got_register(list: tasmlist);
       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
             { FIXME: It is better to use an imaginary register for GOT and
               if EBX is needed for some reason just allocate EBX and

+ 3 - 3
compiler/options.pas

@@ -1485,8 +1485,8 @@ begin
                     'V':
                       begin
                         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
                           init_settings.tlsmodel:=tlsm_local_exec
                         else
@@ -4155,7 +4155,7 @@ begin
   if (tf_section_threadvars in target_info.flags) and (init_settings.tlsmodel=tlsm_none) then
     begin
       if cs_create_pic in init_settings.moduleswitches then
-        init_settings.tlsmodel:=tlsm_general_dynamic
+        init_settings.tlsmodel:=tlsm_global_dynamic
       else
         init_settings.tlsmodel:=tlsm_local_exec;
     end;

+ 2 - 2
compiler/x86/nx86ld.pas

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