문제

In a particular project, I saw the following compiler options used all at once:

gcc foo.c -o foo.o -Icomponent1/subcomponent1 -Icomponent2/subcomponent1 -Wall -fPIC -s

Are the -fPIC and -s used together contradictory here? If not, why?

도움이 되었습니까?

해결책

-s and -fPIC are two flags used for different purposes. They are not contradictory.

From the gcc manual

-s Remove all symbol table and relocation information from the executable.

-fPIC 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top