Why isn't all code compiled position independent?

前端 未结 9 2520
感情败类
感情败类 2020-12-04 10:46

When compiling shared libraries in gcc the -fPIC option compiles the code as position independent. Is there any reason (performance or otherwise) why you would not compile

9条回答
  •  不知归路
    2020-12-04 11:24

    This article explains how PIC works and compares it to the alternative - load time relocation. I think it's relevant to your question.

提交回复
热议问题