Blame elf/tst-sonamemove-link.c

Packit Service aaf481
/* Check that a versioned symbol can move from one library to another.
Packit Service aaf481
   Copyright (C) 2019 Free Software Foundation, Inc.
Packit Service aaf481
   This file is part of the GNU C Library.
Packit Service aaf481
Packit Service aaf481
   The GNU C Library is free software; you can redistribute it and/or
Packit Service aaf481
   modify it under the terms of the GNU Lesser General Public
Packit Service aaf481
   License as published by the Free Software Foundation; either
Packit Service aaf481
   version 2.1 of the License, or (at your option) any later version.
Packit Service aaf481
Packit Service aaf481
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service aaf481
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service aaf481
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service aaf481
   Lesser General Public License for more details.
Packit Service aaf481
Packit Service aaf481
   You should have received a copy of the GNU Lesser General Public
Packit Service aaf481
   License along with the GNU C Library; if not, see
Packit Service aaf481
   <http://www.gnu.org/licenses/>.  */
Packit Service aaf481
Packit Service aaf481
/* At link time, moved_function is bound to the symbol version
Packit Service aaf481
   SONAME_MOVE in tst-sonamemove-runmod1.so, using the
Packit Service aaf481
   tst-sonamemove-linkmod1.so stub object.
Packit Service aaf481
Packit Service aaf481
   At run time, the process loads the real tst-sonamemove-runmod1.so,
Packit Service aaf481
   which depends on tst-sonamemove-runmod2.so.
Packit Service aaf481
   tst-sonamemove-runmod1.so does not define moved_function, but
Packit Service aaf481
   tst-sonamemove-runmod2.so does.
Packit Service aaf481
Packit Service aaf481
   The net effect is that the versioned symbol
Packit Service aaf481
   moved_function@SONAME_MOVE moved from the soname
Packit Service aaf481
   tst-sonamemove-linkmod1.so at link time to the soname
Packit Service aaf481
   tst-sonamemove-linkmod2.so at run time. */
Packit Service aaf481
void moved_function (void);
Packit Service aaf481
Packit Service aaf481
static int
Packit Service aaf481
do_test (void)
Packit Service aaf481
{
Packit Service aaf481
  moved_function ();
Packit Service aaf481
  return 0;
Packit Service aaf481
}
Packit Service aaf481
Packit Service aaf481
#include <support/test-driver.c>