[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Symbol Hiding what am i doing wrong

From: newbei
Subject: Symbol Hiding what am i doing wrong
Date: 28 Mar 2007 04:11:00 -0700
User-agent: G2/1.0

Hello all,

I am trying symbol hiding in GCC version 4.1, but it seems like i am
not doing something right .

Please find here in my example

/* libhello.c*/
int sizeOfLong()
return sizeof(long);

void hello(void) {

printf("size of a short is %d\n", sizeOfInt());
printf("Hello, library world.\n");


/* libhello.h - demonstrate library use. */
#define EXPORT __attribute__((visibility("default")))
EXPORT void hello(void);
int sizeOfInt();

now i compile using the following commands:

gcc -fPIC -fvisibility=hidden -Wall -g -c libhello.c
gcc -g -shared -Wl,-soname, \
    -o libhello.o -lc

do nm

I find both functions hello and sizeOfInt() in it why?

Question 2:

What is the difference between strip and symbol hiding.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]