Blame elf/tst-sonamemove-link.c

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