本帖最后由 hjk857 于 2011-12-11 10:29 编辑 [root@nginx_bak ~]# uname -a Linux nginx_bak 2.6.18-274.12.1.el5 #1 SMP Tue Nov 29 13:37:46 EST 2011 x86_64 x86_64 x86_64 GNU/Linux 在64位的系统是配置安装vlc遇到下面问题。 [root@nginx_bak ~]# make make[6]: Nothing to be done for `all-am'. make[6]: Leaving directory `/usr/local/src/vlc/vlc/modules/codec/omxil' make[5]: Leaving directory `/usr/local/sr...
首先-fpic,gcc手册上说是编译共享库库 -fpic,gcc手册上说是动态链接 是不是-fpic就是支持动态链接的共享库? Configured with: /dw/gaoming/x01tool/buildroot/toolchain_build_arm/gcc-4.0.1/configure --prefix=/dw/buildroot/build_arm/staging_dir --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=arm-linux-uclibc --enable-languages=c,c++ --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld ...
gcc里的参数-fpic的一些问题 根据手册的解释,fpic能增加代码的可重定位性,但是加不加这个参数,好像用起来没什么关系,因此查了些资料,有了些自己的理解。 位置无关代码主要是在访问全局变量和全局函数的时候采用了位置无关的重定位方法,既依赖GOT和PLT来重定位. 普通的重定位方法需要修改代码段,比如偏移地址0x100处需要重定位,loader就修改代码段的0x100处的内容,通过查找重定位信息得到具体的值.这种方法需要修改代...
我使用gcc -fpic选项来编译一段代码,其中需要用到CPUID指令, 编译后出现Can't find register "BREG" while reloading "asm"的错误。 google后得知-fpic选项要求独占ebx寄存器,因而导致编译失败。 这种情况下,我该怎么处理? 非常感谢!
Question: gcc --shared -fpic -o mod_heartmonitor.so mod_heartmonitor.o 之后提示错误: /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: mod_heartmonitor.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fpic mod_heartmonitor.o: could not read symbols: Bad value collect2: ld returned 1 exit status Solution: 生成mod_h...
Question: gcc --shared -fpic -o mod_heartmonitor.so mod_heartmonitor.o 之后提示错误: /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: mod_heartmonitor.o: relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fpic mod_heartmonitor.o: could not read symbols: Bad value collect2: ld returned 1 exit status Solution: 生成mod_h...
加上-fpic参数后,编译后的文件和没有加这个参数的文件,有什么区别呢,在代码里面做了什么修改能增强它的可重定位性,或者说位置无关性呢? 而且,用没有加这个参数的编译后的共享库,也可以使用,它和加了参数后的使用起来又有什么区别呢 谢谢
如题,编译一个.so文件的时候,如果我不加-fpic选项,那么生成的"不可重定位"的代码,在被多个可执行程序加载的时候,在内存中是会生成一个实例还是多个实例? 如果也是只有一个实例的话,那加不加-fpic有什么区别呢? 谢谢!
make 时遇到下面的报错。本人不太清除。尤其对fpic不是很清楚。哪位达人指点下如何解决呢。 我用的是 fedora 13 x86_64系统。 ”Linux yy.localdomain 2.6.33.3-85.fc13.x86_64 #1 SMP Thu May 6 18:09:49 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux “ Building shared object library: ../libs/libfap.so /usr/bin/ld: lib/area.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompi...