hppa: fix loading of global pointer in _start [BZ #20277]
[glibc.git] / sysdeps / nacl / nacl_interface_query.c
blobadf1dd4c02a9f446b3b2b33228c696a46c7d96eb
1 /* NaCl function exposing IRT interface query.
2 Copyright (C) 2015-2016 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #include <nacl-interfaces.h>
20 #include <ldsodefs.h>
22 #ifdef SHARED
24 /* We can define this trivially using IFUNC rather than a wrapper
25 because we absolutely require that we get the IRT interface query
26 function pointer via AT_SYSINFO. */
28 extern TYPE_nacl_irt_query nacl_interface_query_ifunc (void)
29 asm ("nacl_interface_query");
31 TYPE_nacl_irt_query
32 nacl_interface_query_ifunc (void)
34 return &__nacl_irt_query;
36 asm (".type nacl_interface_query, %gnu_indirect_function");
38 #else
40 /* In the static library, using IFUNC is just extra overhead. */
42 size_t
43 nacl_interface_query (const char *interface_ident,
44 void *table, size_t tablesize)
46 return __nacl_irt_query (interface_ident, table, tablesize);
49 #endif