diff options
-rw-r--r-- | include/slibtool/slibtool_arbits.h | 5 | ||||
-rw-r--r-- | src/internal/slibtool_visibility_impl.h | 16 |
2 files changed, 13 insertions, 8 deletions
diff --git a/include/slibtool/slibtool_arbits.h b/include/slibtool/slibtool_arbits.h index 862b5fa..fc04ab7 100644 --- a/include/slibtool/slibtool_arbits.h +++ b/include/slibtool/slibtool_arbits.h @@ -8,6 +8,9 @@ extern "C" { #include <stdint.h> #include <stddef.h> +#ifndef AR_COMMON_DEFS +#define AR_COMMON_DEFS + #define AR_SIGNATURE "!<arch>\n" #define AR_MEMBER_ATTR_DEFAULT (0x00) @@ -181,6 +184,8 @@ struct ar_meta_armap_info { const struct ar_meta_armap_common_64 * ar_armap_common_64; }; +#endif + #ifdef __cplusplus } #endif diff --git a/src/internal/slibtool_visibility_impl.h b/src/internal/slibtool_visibility_impl.h index 2bdded0..44ab2dd 100644 --- a/src/internal/slibtool_visibility_impl.h +++ b/src/internal/slibtool_visibility_impl.h @@ -7,20 +7,20 @@ /* attribute not only redundant, but also tricky if not properly */ /* supported by the toolchain. */ /* */ -/* When targeting Midipix, __PE__, __dllexport and __dllimport are */ -/* always defined by the toolchain. Otherwise, the absnece of these */ -/* macros has been detected by sofort's ccenv.sh during ./configure, */ -/* and they have accordingly been added to CFLAGS_OS. */ +/* When targeting Midipix hosts, where elf-like visibility is fully */ +/* supported and may be detected via the __PE_VISIBILITY__ macro, */ +/* we utilize the attribute to render private symbols invisibile */ +/* to dlsym(), as well as reduce the size of the .gotstrs section. */ /**********************************************************************/ -#ifdef __PE__ +#if defined(__PE_VISIBILITY__) +#define slbt_hidden _ATTR_VISIBILITY_HIDDEN +#elif defined(__PE__) #define slbt_hidden -#else -#ifdef _ATTR_VISIBILITY_HIDDEN +#elif defined(_ATTR_VISIBILITY_HIDDEN) #define slbt_hidden _ATTR_VISIBILITY_HIDDEN #else #define slbt_hidden #endif -#endif #endif |