浏览代码

* create a thumb_func directive before .globl directives in assembler to prevent accidental changes of asm mode

git-svn-id: trunk@28556 -
florian 11 年之前
父节点
当前提交
3f18d85434
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      compiler/aggas.pas

+ 5 - 0
compiler/aggas.pas

@@ -1244,6 +1244,11 @@ implementation
                     end;
                     end;
                   if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
                   if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
                    begin
                    begin
+{$ifdef arm}
+                     { do no change arm mode accidently, .globl seems to reset the mode }
+                     if GenerateThumbCode or GenerateThumb2Code then
+                       AsmWriteln(#9'.thumb_func'#9);
+{$endif arm}
                      AsmWrite('.globl'#9);
                      AsmWrite('.globl'#9);
                      if replaceforbidden then
                      if replaceforbidden then
                        AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))
                        AsmWriteLn(ReplaceForbiddenAsmSymbolChars(tai_label(hp).labsym.name))