Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
-fpic与fpic powerpc混淆_C_Powerpc - Fatal编程技术网

-fpic与fpic powerpc混淆

-fpic与fpic powerpc混淆,c,powerpc,C,Powerpc,我试图用一些简单的代码重现我遇到的一个问题。我编写了一个小脚本来生成一个C文件,如下所示: int SYM_0 = 0; int SYM_1 = 1; int SYM_2 = 2; int SYM_3 = 3; int SYM_4 = 4; . . . int SYM_16384 = 16384; int main() { int sum = 0; sum += SYM_0; sum += SYM_1; sum += SYM_2; sum += SYM_3; sum

我试图用一些简单的代码重现我遇到的一个问题。我编写了一个小脚本来生成一个C文件,如下所示:

int SYM_0 = 0;
int SYM_1 = 1;
int SYM_2 = 2;
int SYM_3 = 3;
int SYM_4 = 4;
.
.
.
int SYM_16384 = 16384; 

int main() {
  int sum = 0;
  sum += SYM_0;
  sum += SYM_1;
  sum += SYM_2;
  sum += SYM_3;
  sum += SYM_4;
  .
  .
  .
  sum += SYM_16384;
  return sum;
}
基本上是16385个全局变量。当我现在用-fpic编译它时,它编译没有错误。然而,当我使用-fPIC编译时,我得到:

/tmp/ccCB1pty.s: Assembler messages:
/tmp/ccCB1pty.s:229412: Error: operand out of range (0x00008000 is not between 0xffff8000 and 0x00007fff)
我很困惑,因为从我读到的内容来看,-fPIC应该允许每个函数有16k个条目的最大数量的get条目,其中as-fPIC总共是16k个条目。那么,为什么我用fPIC而不是fPIC得到错误呢