构建一个共享库时是什么意思-fPIC? [英] What does -fPIC mean when building a shared library?

查看:148
本文介绍了构建一个共享库时是什么意思-fPIC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道了 -fPIC 选项是与解决地址和各个模块之间的独立性,但我不知道它的真正含义。你能解释一下吗?

I know the '-fPIC' option has something to do with resolving addresses and independence between individual modules, but I'm not sure what it really means. Can you explain?

推荐答案

PIC表示位置无关code

PIC stands for Position Independent Code

和报价男人的gcc

如果支持的目标机器上,发出与位置无关的code,适用于动态链接和避免对全局偏移表的大小的限制。此选项使在m68k的,PowerPC和SPARC的差异。位置无关code需要特殊支持,因此只适用于某些机器。

If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table. This option makes a difference on the m68k, PowerPC and SPARC. Position-independent code requires special support, and therefore works only on certain machines.

(*的.so)上提到的那些架构构建共享对象时使用。

use this when building shared objects (*.so) on those mentioned architectures.

这篇关于构建一个共享库时是什么意思-fPIC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆