diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-04-13 14:18:38 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-04-13 14:18:38 +0000 |
commit | 1c82d532474798a1b07f85c5a925a2ad27ac2c27 (patch) | |
tree | ff3b99eaeef8784f81793c8a39a54222a24a0493 /src/hidden-visibility.h | |
parent | a822d2d11872c10925e7f2bfa65b27e30a9700a5 (diff) |
add hidden visibility support to libeinfo as well
Diffstat (limited to 'src/hidden-visibility.h')
-rw-r--r-- | src/hidden-visibility.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/hidden-visibility.h b/src/hidden-visibility.h new file mode 100644 index 00000000..bc8d4c4d --- /dev/null +++ b/src/hidden-visibility.h @@ -0,0 +1,28 @@ +/* + * hidden-visibility.h + * Create hidden internal aliases so we dont have wasteful relocs. + * Copyright 2007 Gentoo Foundation + * Released under the GPLv2 + */ + +#ifndef _HIDDEN_VISIBILITY_H_ +#define _HIDDEN_VISIBILITY_H_ + +#if defined(__ELF__) && defined(__GNUC__) +# define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name) +# define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name) +# define __hidden_asmname2(prefix, name) #prefix name +# define __hidden_proto(name, internal) \ + extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \ + __attribute__ ((visibility ("hidden"))); +# define __hidden_ver(local, internal, name) \ + extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \ + extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local)))) +# define hidden_proto(name) __hidden_proto(name, __RC_##name) +# define hidden_def(name) __hidden_ver(__RC_##name, name, name); +#else +# define hidden_proto(name) +# define hidden_def(name) +#endif + +#endif |