Browse Source

* the fact that a procedure is local does not mean that it by definition
does not need a GOT pointer (mantis #11852)

git-svn-id: trunk@11586 -

Jonas Maebe 17 years ago
parent
commit
6697f173b6
3 changed files with 30 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 1 2
      compiler/i386/cgcpu.pas
  3. 28 0
      tests/webtbs/tw11852.pp

+ 1 - 0
.gitattributes

@@ -8540,6 +8540,7 @@ tests/webtbs/tw1157b.pp svneol=native#text/plain
 tests/webtbs/tw11619.pp svneol=native#text/plain
 tests/webtbs/tw1181.pp svneol=native#text/plain
 tests/webtbs/tw11848.pp svneol=native#text/plain
+tests/webtbs/tw11852.pp svneol=native#text/plain
 tests/webtbs/tw1203.pp svneol=native#text/plain
 tests/webtbs/tw1204.pp svneol=native#text/plain
 tests/webtbs/tw1207.pp svneol=native#text/plain

+ 1 - 2
compiler/i386/cgcpu.pas

@@ -493,8 +493,7 @@ unit cgcpu;
         { allocate PIC register }
         if (cs_create_pic in current_settings.moduleswitches) and
            (tf_pic_uses_got in target_info.flags) and
-           (pi_needs_got in current_procinfo.flags) and
-           not(po_kylixlocal in current_procinfo.procdef.procoptions) then
+           (pi_needs_got in current_procinfo.flags) then
           begin
             if (target_info.system<>system_i386_darwin) then
               begin

+ 28 - 0
tests/webtbs/tw11852.pp

@@ -0,0 +1,28 @@
+unit tw11852;
+
+interface
+
+function _hc_test( inp: integer ): integer; CDecl;
+
+implementation
+
+uses
+  Classes, Types, SysUtils;
+
+function _hc_test( inp: integer ): integer; CDecl;
+begin
+  _hc_test := inp;
+end;
+
+procedure __func; local;
+begin
+  WriteLn( 'local function' );
+end;
+
+initialization
+  __func;
+
+end.
+
+//= END OF FILE ===============================================================
+