나는 최근에 GNU ld에서 링커 옵션 "-Bsymbolic-functions"을 발견했다 :-Bymbolic-functions을 사용할 때 단점이 있습니까?
-Bsymbolic
When creating a shared library, bind references to global symbols to the
definition within the shared library, if any. Normally, it is possible
for a program linked against a shared library to override the definition
within the shared library.
This option is only meaningful on ELF platforms which support shared libraries.
-Bsymbolic-functions
When creating a shared library, bind references to global function symbols
to the definition within the shared library, if any.
This option is only meaningful on ELF platforms which support shared libraries.
이것은 GCC 옵션 인 -fvisibility=hidden
의 역함이 며 대신 참조 된 함수를 다른 공유 함수로 내보내는 것을 막는다. 해당 함수에 대한 라이브러리 내부 참조가 다른 공유 오브젝트의 내 보낸 함수에 바인드되는 것을 방지합니다. 나는 -Bsymbolic-functions
이 좋은 부작용 인 함수에 대한 PLT 엔트리의 생성을 막을 것이라고 스스로에게 알렸다.
그러나 라이브러리의 개별 함수 정의에 대해
-Bsymbolic
를 덮어 쓰는 것과 같이 더 세밀하게 제어 할 수 있는지 궁금합니다.-Bsymbolic-functions
을 사용했을 때의 함정을 알고 있어야합니까?-Bsymbolic
이 예외를 깨기 때문에 나는 그것을 사용할 계획이다. (생각하면 typeinfo 객체에 대한 참조가 통일되어 있지 않을 것이다.)
고마워!
당신은 나를 위해 링커 지옥의 시간을 영광스럽고 행복하게 해결했습니다. 나는 너를 좀 사랑해. –