Răsfoiți Sursa

+ emit .type directives for ait_symbolpair on targets that have tf_needs_symbol_type

git-svn-id: branches/wasm@47002 -
nickysn 4 ani în urmă
părinte
comite
b230e295fa
1 a modificat fișierele cu 14 adăugiri și 0 ștergeri
  1. 14 0
      compiler/aggas.pas

+ 14 - 0
compiler/aggas.pas

@@ -1428,6 +1428,10 @@ implementation
                  { the .localentry directive has to specify the size from the
                    start till here of the non-local entry code as second argument }
                  s:=', .-';
+               if ((target_info.system <> system_arm_linux) and (target_info.system <> system_arm_android)) then
+                 sepChar := '@'
+               else
+                 sepChar := '#';
                if replaceforbidden then
                  begin
                    { avoid string truncation }
@@ -1439,6 +1443,11 @@ implementation
                        writer.AsmWrite(#9'.globl ');
                        writer.AsmWriteLn(ApplyAsmSymbolRestrictions(tai_symbolpair(hp).sym^));
                      end;
+                   if (tf_needs_symbol_type in target_info.flags) then
+                     begin
+                       writer.AsmWrite(#9'.type'#9 + ApplyAsmSymbolRestrictions(tai_symbolpair(hp).sym^));
+                       writer.AsmWriteLn(',' + sepChar + 'function');
+                     end;
                  end
                else
                  begin
@@ -1451,6 +1460,11 @@ implementation
                        writer.AsmWrite(#9'.globl ');
                        writer.AsmWriteLn(tai_symbolpair(hp).sym^);
                      end;
+                   if (tf_needs_symbol_type in target_info.flags) then
+                     begin
+                       writer.AsmWrite(#9'.type'#9 + tai_symbolpair(hp).sym^);
+                       writer.AsmWriteLn(',' + sepChar + 'function');
+                     end;
                  end;
              end;
            ait_symbol_end :