|
Packit Service |
2bc138 |
/* Test relocation ordering if the main executable is libc.so.6 (bug 20972).
|
|
Packit Service |
2bc138 |
Copyright (C) 2020 Free Software Foundation, Inc.
|
|
Packit Service |
2bc138 |
This file is part of the GNU C Library.
|
|
Packit Service |
2bc138 |
|
|
Packit Service |
2bc138 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
2bc138 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
2bc138 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
2bc138 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
2bc138 |
|
|
Packit Service |
2bc138 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
2bc138 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
2bc138 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
2bc138 |
Lesser General Public License for more details.
|
|
Packit Service |
2bc138 |
|
|
Packit Service |
2bc138 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
2bc138 |
License along with the GNU C Library; if not, see
|
|
Packit Service |
2bc138 |
<https://www.gnu.org/licenses/>. */
|
|
Packit Service |
2bc138 |
|
|
Packit Service |
2bc138 |
#include <gnu/lib-names.h>
|
|
Packit Service |
2bc138 |
#include <stdio.h>
|
|
Packit Service |
2bc138 |
#include <support/support.h>
|
|
Packit Service |
2bc138 |
#include <unistd.h>
|
|
Packit Service |
2bc138 |
|
|
Packit Service |
2bc138 |
int
|
|
Packit Service |
2bc138 |
main (void)
|
|
Packit Service |
2bc138 |
{
|
|
Packit Service |
2bc138 |
char *libc = xasprintf ("%s/%s", support_slibdir_prefix, LIBC_SO);
|
|
Packit Service |
2bc138 |
char *argv[] = { libc, NULL };
|
|
Packit Service |
2bc138 |
char *envp[] = { (char *) "LD_PRELOAD=" LIBPTHREAD_SO,
|
|
Packit Service |
2bc138 |
/* Relocation ordering matters most without lazy binding. */
|
|
Packit Service |
2bc138 |
(char *) "LD_BIND_NOW=1",
|
|
Packit Service |
2bc138 |
NULL };
|
|
Packit Service |
2bc138 |
execve (libc, argv, envp);
|
|
Packit Service |
2bc138 |
printf ("execve of %s failed: %m\n", libc);
|
|
Packit Service |
2bc138 |
return 1;
|
|
Packit Service |
2bc138 |
}
|