Blame elf/tst-sonamemove-dlopen.c

Packit Service d31951
/* Check that a moved versioned symbol can be found using dlsym, dlvsym.
Packit Service d31951
   Copyright (C) 2019 Free Software Foundation, Inc.
Packit Service d31951
   This file is part of the GNU C Library.
Packit Service d31951
Packit Service d31951
   The GNU C Library is free software; you can redistribute it and/or
Packit Service d31951
   modify it under the terms of the GNU Lesser General Public
Packit Service d31951
   License as published by the Free Software Foundation; either
Packit Service d31951
   version 2.1 of the License, or (at your option) any later version.
Packit Service d31951
Packit Service d31951
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service d31951
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service d31951
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service d31951
   Lesser General Public License for more details.
Packit Service d31951
Packit Service d31951
   You should have received a copy of the GNU Lesser General Public
Packit Service d31951
   License along with the GNU C Library; if not, see
Packit Service d31951
   <http://www.gnu.org/licenses/>.  */
Packit Service d31951
Packit Service d31951
#include <stddef.h>
Packit Service d31951
#include <support/check.h>
Packit Service d31951
#include <support/xdlfcn.h>
Packit Service d31951
Packit Service d31951
static int
Packit Service d31951
do_test (void)
Packit Service d31951
{
Packit Service d31951
  /* tst-sonamemove-runmod1.so does not define moved_function, but it
Packit Service d31951
     depends on tst-sonamemove-runmod2.so, which does.  */
Packit Service d31951
  void *handle = xdlopen ("tst-sonamemove-runmod1.so", RTLD_NOW);
Packit Service d31951
  TEST_VERIFY (xdlsym (handle, "moved_function") != NULL);
Packit Service d31951
  TEST_VERIFY (xdlvsym (handle, "moved_function", "SONAME_MOVE") != NULL);
Packit Service d31951
Packit Service d31951
  return 0;
Packit Service d31951
}
Packit Service d31951
Packit Service d31951
#include <support/test-driver.c>