This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Hiding symbol on dynamic shared objects


On Wed, Jan 24, 2001 at 01:43:57AM -0800, Mevorach, Assaf wrote:
> Hi
> I write a library in C, on GNU/Linux machine, and I would like to know if
> there is a way to hide my symbols
> (inner functions and global variables) from out of the DSO scope in order
> not to pollute the whole image name space.

It is very trivial to do under Linux. You can use symbol versioning.
You can use a map like

--mylib.map---
MYLIB {
  local:
   *;
};
---

# gcc -shared -o mylib .... -Wl,--version-script=mylib.map


H.J.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]