1 /* Copyright (c) 2014, Google Inc. 2 * 3 * Permission to use, copy, modify, and/or distribute this software for any 4 * purpose with or without fee is hereby granted, provided that the above 5 * copyright notice and this permission notice appear in all copies. 6 * 7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 14 15 #include <ring-core/base.h> 16 17 #if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) 18 // Our assembly does not use the GOT to reference symbols, which means 19 // references to visible symbols will often require a TEXTREL. This is 20 // undesirable, so all assembly-referenced symbols should be hidden. CPU 21 // capabilities are the only such symbols defined in C. Explicitly hide them, 22 // rather than rely on being built with -fvisibility=hidden. 23 #if defined(OPENSSL_WINDOWS) 24 #define HIDDEN 25 #else 26 #define HIDDEN __attribute__((visibility("hidden"))) 27 #endif 28 29 // This value must be explicitly initialised to zero in order to work around a 30 // bug in libtool or the linker on OS X. 31 // 32 // If not initialised then it becomes a "common symbol". When put into an 33 // archive, linking on OS X will fail to resolve common symbols. By 34 // initialising it to zero, it becomes a "data symbol", which isn't so 35 // affected. 36 HIDDEN uint32_t OPENSSL_ia32cap_P[4] = {0}; 37 #endif 38