Blame elf/tst-linkall-static.c

Packit 6c4009
/* Test static linking against multiple libraries, to find symbol conflicts.
Packit 6c4009
   Copyright (C) 2016-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public License as
Packit 6c4009
   published by the Free Software Foundation; either version 2.1 of the
Packit 6c4009
   License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; see the file COPYING.LIB.  If
Packit 6c4009
   not, see <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#include <math.h>
Packit 6c4009
#include <pthread.h>
Packit 6c4009
#if USE_CRYPT
Packit 6c4009
# include <crypt.h>
Packit 6c4009
#endif
Packit 6c4009
#include <resolv.h>
Packit 6c4009
#include <dlfcn.h>
Packit 6c4009
#include <utmp.h>
Packit 6c4009
#include <aio.h>
Packit 6c4009
#include <netdb.h>
Packit 6c4009
Packit 6c4009
/* These references force linking the executable against central
Packit 6c4009
   functions in the static libraries, pulling significant parts of
Packit 6c4009
   each library into the link.  */
Packit 6c4009
void *references[] =
Packit 6c4009
  {
Packit 6c4009
    &pow,                       /* libm */
Packit 6c4009
    &pthread_create,            /* libpthread */
Packit 6c4009
#if USE_CRYPT
Packit 6c4009
    &crypt,                     /* libcrypt */
Packit 6c4009
#endif
Packit 6c4009
    &res_send,                  /* libresolv */
Packit 6c4009
    &dlopen,                    /* libdl */
Packit 6c4009
    &login,                     /* libutil */
Packit 6c4009
    &aio_init,                  /* librt */
Packit 6c4009
    &getaddrinfo_a,             /* libanl */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
static int
Packit 6c4009
do_test (void)
Packit 6c4009
{
Packit 6c4009
  /* This is a link-time test.  There is nothing to run here.  */
Packit 6c4009
  return 0;
Packit 6c4009
}
Packit 6c4009
Packit 6c4009
#include <support/test-driver.c>