ELF visibility attributes can now be applied to a class type, so that it affects every member function of a class at once, without having to specify each individually:
class __attribute__ ((visibility("hidden"))) Foo
{
int foo1();
void foo2();
};
The syntax is deliberately similar to the __declspec() system used by Microsoft Windows based compilers, allowing cross-platform projects to easily reuse their existing macro system for denoting exports and imports. By explicitly marking internal classes never used outside a binary as hidden, one can completely avoid PLT indirection overheads during their usage by the compiler. You can find out more about the advantages of this at http://people.redhat.com/drepper/dsohowto.pdf
맨 아래 링크된 pdf 파일은 상당히 좋군요.
자세히 보진 않았지만, GCC 4.0 이전에는 클래스를 완전히 숨기는 것은 불가능했던거 같네요.
static음, static
static
음, static
저두 해 보질 못해서 뭐라고 말씀 못드리겠군요.하지만, 한번 해 보시
저두 해 보질 못해서 뭐라고 말씀 못드리겠군요.
하지만, 한번 해 보시기 바랍니다.
gcc -c -Dexport=MyExport some_file.cc
WOW Wow!!!
Computer Science is no more about computers than astronomy is about telescopes.
-- E. W. Dijkstra
함수의 경우에는 static을 쓰면 되지만 class는?
함수의 경우
static void Func(); 과 같은 식으로 선언하면
다른 라이브러리,실행파일에서 이 함수를 사용하지 못하지만..
클래스의 경우에는 어떻게 해야하는지 모르겠군요
Re: 좀 지나간 스레드긴 하지만..
GCC 4.0 의 changes 를 보다가 이쪽 관련된 변경점을 봐서 올려봅니다.
맨 아래 링크된 pdf 파일은 상당히 좋군요.
자세히 보진 않았지만, GCC 4.0 이전에는 클래스를 완전히 숨기는 것은 불가능했던거 같네요.
댓글 달기