Blame elf/tst-sonamemove-link.c

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