gcc -shared -o hack.so hack.c/usr/bin/ld: /tmp/ccUZREwA.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC/tmp/ccUZREwA.o: could not read symbols: Bad valuecollect2: ld returned 1 exit…
前两天看程序,发现在某个函数中有下面这段程序: int n; //define a variable n int array[n]; //define an array with length n 在我所学的C语言知识中,这种数组的定义在编译时就应该有问题的,因为定义数组时,数组的长度必须要是一个大于0的整型字面值或定义为 const 的常量.例如下面这样 int array1[10]; //valid int const N = 10; int array2[N]; //valid int n…