Blame elf/tst-sonamemove-dlopen.c

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