embeded/ARM

gcc -lz 와 -z

구차니 2015. 2. 12. 15:00

-lz는 libz.so를 쓰라는거고

-z는 실수로 친건데

이상한 ld 파일을 끌어와서 하길래 멘붕와서 찾아봐도

이렇다할 설명이 없다.


아무튼.. -z text 라고 되어있고 이게 링커에게 옵션으로 던져주는것 같은데

-lz 대신 -z로 입력해서 그 뒤의 값이 링커에게 넘어갔던 것으로 생각된다.


-mimpure-text
-mimpure-text, used in addition to -shared, tells the compiler to not pass -z text to the linker when linking a shared object. Using this option, you can link position-dependent code into a shared object.

[링크 : http://linux.die.net/man/1/gcc]