Kaynağa Gözat

Add Warning/Hint if changing bind type after assembler symbol has
been used already.
Warning if from Global to local, temporarily downgraded to Note
to avoid faling cycle as -Sew is default.

git-svn-id: trunk@29449 -

pierre 10 yıl önce
ebeveyn
işleme
a959b1a6ef
1 değiştirilmiş dosya ile 11 ekleme ve 6 silme
  1. 11 6
      compiler/aasmdata.pas

+ 11 - 6
compiler/aasmdata.pas

@@ -406,12 +406,17 @@ implementation
                  internalerror(200603261);
              end;
            hp.typ:=_typ;
-{$ifdef x86_64}
-           { On x86_64 at least changing bind from AB_GLOBAL to AB_LOCAL is wrong
-             if bind is already AB_GLOBAL, GOT might be involved, so do not change. }
-           if (_bind<>AB_LOCAL) or (hp.bind<>AB_GLOBAL) then
-{$endif x86_64}
-             hp.bind:=_bind;
+           { Changing bind from AB_GLOBAL to AB_LOCAL is wrong
+             if bind is already AB_GLOBAL or AB_EXTERNAL,
+             GOT might have been used, so change might be harmful. }
+           if (_bind<>hp.bind) and (hp.getrefs>0) then
+             begin
+               if (_bind=AB_LOCAL) then
+                 Message3(asmw_w_changing_bind_type,s,asmsymbindname[hp.bind],asmsymbindname[_bind])
+               else
+                 Message3(asmw_h_changing_bind_type,s,asmsymbindname[hp.bind],asmsymbindname[_bind]);
+             end;
+           hp.bind:=_bind;
          end
         else
          begin