This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/mbind/master created. glibc-2.23-39-ge7c8732
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 25 Feb 2016 22:46:17 -0000
- Subject: GNU C Library master sources branch hjl/mbind/master created. glibc-2.23-39-ge7c8732
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, hjl/mbind/master has been created
at e7c8732fe27d1c97fc60e94112ba94395edba73f (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e7c8732fe27d1c97fc60e94112ba94395edba73f
commit e7c8732fe27d1c97fc60e94112ba94395edba73f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Feb 25 14:45:48 2016 -0800
Change __gnu_mbind_setup prototype
diff --git a/sysdeps/x86/init-mbind.h b/sysdeps/x86/init-mbind.h
index c88f594..417c95b 100644
--- a/sysdeps/x86/init-mbind.h
+++ b/sysdeps/x86/init-mbind.h
@@ -20,7 +20,7 @@
#include <setup-mbind.h>
static inline void
-init_mbind (const char *name, const ElfW(Phdr) *phdr, size_t phnum,
+init_mbind (const char *filename, const ElfW(Phdr) *phdr, size_t phnum,
ElfW(Addr) load)
{
/* FIXME: Need to check PT_GNU_MBIND segment for signature
@@ -28,15 +28,14 @@ init_mbind (const char *name, const ElfW(Phdr) *phdr, size_t phnum,
for (; phnum; phnum--, phdr++)
if (phdr->p_type == PT_LOAD)
{
- const char *signature = "foobar";
- if (signature)
+ const char *name = "foobar";
+ if (name)
{
- void *addr = (void *) (uintptr_t) (load + phdr->p_vaddr);
- int error_code = __gnu_mbind_setup (name, signature, addr,
- phdr->p_memsz);
+ int error_code = __gnu_mbind_setup (filename, name, load,
+ phdr, 1);
if (error_code < 0)
_dl_fatal_printf (N_("_dl_mbind failed on file %s with signature %s: error 0x%x\n"),
- name, signature, -error_code);
+ filename, name, -error_code);
}
break;
}
diff --git a/sysdeps/x86/setup-mbind.c b/sysdeps/x86/setup-mbind.c
index 626d834..f2d68f5 100644
--- a/sysdeps/x86/setup-mbind.c
+++ b/sysdeps/x86/setup-mbind.c
@@ -20,9 +20,10 @@
int weak_function
__gnu_mbind_setup (const char *filename __attribute__ ((unused)),
- const char *signature __attribute__ ((unused)),
- void *addr __attribute__ ((unused)),
- size_t length __attribute__ ((unused)))
+ const char *name __attribute__ ((unused)),
+ ElfW(Addr) load __attribute__ ((unused)),
+ const ElfW(Phdr) *phdr __attribute__ ((unused)),
+ int relocated __attribute__ ((unused)))
{
return 0;
}
diff --git a/sysdeps/x86/setup-mbind.h b/sysdeps/x86/setup-mbind.h
index 12e3a75..9e5e93c 100644
--- a/sysdeps/x86/setup-mbind.h
+++ b/sysdeps/x86/setup-mbind.h
@@ -16,7 +16,9 @@
<http://www.gnu.org/licenses/>. */
#include <stddef.h>
+#include <link.h>
/* Set up special memory. */
extern int weak_function __gnu_mbind_setup (const char *, const char *,
- void *, size_t);
+ ElfW(Addr), const ElfW(Phdr) *,
+ int);
diff --git a/sysdeps/x86/tst-mbind1.c b/sysdeps/x86/tst-mbind1.c
index cf4e16d..6f9512b 100644
--- a/sysdeps/x86/tst-mbind1.c
+++ b/sysdeps/x86/tst-mbind1.c
@@ -17,6 +17,7 @@
#include <string.h>
#include <stdio.h>
+#include <link.h>
static int mbind_called;
#ifndef PROGRAM_NAME
@@ -25,9 +26,10 @@ static int mbind_called;
int
__gnu_mbind_setup (const char *filename,
- const char *signature __attribute__ ((unused)),
- void *addr __attribute__ ((unused)),
- size_t length __attribute__ ((unused)))
+ const char *name __attribute__ ((unused)),
+ ElfW(Addr) load __attribute__ ((unused)),
+ const ElfW(Phdr) *phdr __attribute__ ((unused)),
+ int relocated __attribute__ ((unused)))
{
size_t len = strlen (filename);
size_t program_size = sizeof (PROGRAM_NAME);
diff --git a/sysdeps/x86/tst-mbind2.c b/sysdeps/x86/tst-mbind2.c
index da1d965..3dbc896 100644
--- a/sysdeps/x86/tst-mbind2.c
+++ b/sysdeps/x86/tst-mbind2.c
@@ -17,6 +17,7 @@
#include <string.h>
#include <stdio.h>
+#include <link.h>
static int mbind_called;
#ifndef PROGRAM_NAME
@@ -30,9 +31,10 @@ extern void mbind_test (void);
int
__gnu_mbind_setup (const char *filename,
- const char *signature __attribute__ ((unused)),
- void *addr __attribute__ ((unused)),
- size_t length __attribute__ ((unused)))
+ const char *name __attribute__ ((unused)),
+ ElfW(Addr) load __attribute__ ((unused)),
+ const ElfW(Phdr) *phdr __attribute__ ((unused)),
+ int relocated __attribute__ ((unused)))
{
size_t len = strlen (filename);
size_t program_size = sizeof (PROGRAM_NAME);
diff --git a/sysdeps/x86/tst-mbind3mod.c b/sysdeps/x86/tst-mbind3mod.c
index 5551097..dbcf10a 100644
--- a/sysdeps/x86/tst-mbind3mod.c
+++ b/sysdeps/x86/tst-mbind3mod.c
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <string.h>
+#include <link.h>
int mbind_called;
#ifndef PROGRAM_NAME
@@ -24,9 +25,10 @@ int mbind_called;
int
__gnu_mbind_setup (const char *filename,
- const char *signature __attribute__ ((unused)),
- void *addr __attribute__ ((unused)),
- size_t length __attribute__ ((unused)))
+ const char *name __attribute__ ((unused)),
+ ElfW(Addr) load __attribute__ ((unused)),
+ const ElfW(Phdr) *phdr __attribute__ ((unused)),
+ int relocated __attribute__ ((unused)))
{
size_t len = strlen (filename);
size_t program_size = sizeof (PROGRAM_NAME);
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=acb7fd800a1348ebb4f5d0aab829b6f9f62eefa5
commit acb7fd800a1348ebb4f5d0aab829b6f9f62eefa5
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Oct 7 12:58:12 2015 -0700
Add __gnu_mbind_setup and some tests
diff --git a/csu/init-first.c b/csu/init-first.c
index 77c6e1c..a58ef63 100644
--- a/csu/init-first.c
+++ b/csu/init-first.c
@@ -77,6 +77,10 @@ _init (int argc, char **argv, char **envp)
/* First the initialization which normally would be done by the
dynamic linker. */
_dl_non_dynamic_init ();
+
+# ifdef INIT_MBIND
+ INIT_MBIND (argv[0], _dl_phdr, _dl_phnum, 0);
+# endif
#endif
#ifdef VDSO_SETUP
diff --git a/elf/dl-init.c b/elf/dl-init.c
index 818c3aa..b20bbc8 100644
--- a/elf/dl-init.c
+++ b/elf/dl-init.c
@@ -35,6 +35,14 @@ call_init (struct link_map *l, int argc, char **argv, char **env)
dependency. */
l->l_init_called = 1;
+#ifdef INIT_MBIND
+ if (l->l_phdr)
+ {
+ const char *name = l->l_name[0] == '\0' ? argv[0] : l->l_name;
+ INIT_MBIND (name, l->l_phdr, l->l_phnum, l->l_addr);
+ }
+#endif
+
/* Check for object which constructors we do not run here. */
if (__builtin_expect (l->l_name[0], 'a') == '\0'
&& l->l_type == lt_executable)
diff --git a/elf/dl-support.c b/elf/dl-support.c
index c30194c..8f2241d 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -383,3 +383,7 @@ _dl_non_dynamic_init (void)
#ifdef DL_SYSINFO_IMPLEMENTATION
DL_SYSINFO_IMPLEMENTATION
#endif
+
+#ifdef INIT_MBIND
+# include <setup-mbind.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86/ldsodefs.h b/sysdeps/unix/sysv/linux/x86/ldsodefs.h
new file mode 100644
index 0000000..1b1c1f8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/ldsodefs.h
@@ -0,0 +1,26 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects. x86
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LDSODEFS_H
+
+/* Get the real definitions. */
+#include_next <ldsodefs.h>
+
+#include <init-mbind.h>
+
+#endif /* ldsodefs.h */
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 0de4f42..3bc1222 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -3,8 +3,19 @@ gen-as-const-headers += cpu-features-offsets.sym rtld-global-offsets.sym
endif
ifeq ($(subdir),elf)
-sysdep-dl-routines += dl-get-cpu-features
+sysdep-dl-routines += dl-get-cpu-features setup-mbind
-tests += tst-get-cpu-features
-tests-static += tst-get-cpu-features-static
+tests += tst-get-cpu-features tst-mbind1 tst-mbind2 tst-mbind3
+tests-static += tst-get-cpu-features-static tst-mbind1-static
+
+modules-names += tst-mbind2mod tst-mbind3mod
+
+$(objpfx)tst-mbind2: $(objpfx)tst-mbind2mod.so
+$(objpfx)tst-mbind3: $(objpfx)tst-mbind3mod.so
+
+ifeq (yesyes,$(have-fpie)$(build-shared))
+tests += tst-mbind1-pie
+tests-pie += tst-mbind1-pie
+CFLAGS-tst-mbind1-pie.c += $(pie-ccflag)
+endif
endif
diff --git a/sysdeps/x86/Versions b/sysdeps/x86/Versions
index e029237..a627762 100644
--- a/sysdeps/x86/Versions
+++ b/sysdeps/x86/Versions
@@ -1,5 +1,8 @@
ld {
GLIBC_PRIVATE {
__get_cpu_features;
+
+ # Set up special memory.
+ __gnu_mbind_setup;
}
}
diff --git a/sysdeps/x86/init-mbind.h b/sysdeps/x86/init-mbind.h
new file mode 100644
index 0000000..c88f594
--- /dev/null
+++ b/sysdeps/x86/init-mbind.h
@@ -0,0 +1,45 @@
+/* This file is part of the GNU C Library.
+ Copyright (C) 2016 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <libintl.h>
+#include <setup-mbind.h>
+
+static inline void
+init_mbind (const char *name, const ElfW(Phdr) *phdr, size_t phnum,
+ ElfW(Addr) load)
+{
+ /* FIXME: Need to check PT_GNU_MBIND segment for signature
+ instead of use "foobar" here. */
+ for (; phnum; phnum--, phdr++)
+ if (phdr->p_type == PT_LOAD)
+ {
+ const char *signature = "foobar";
+ if (signature)
+ {
+ void *addr = (void *) (uintptr_t) (load + phdr->p_vaddr);
+ int error_code = __gnu_mbind_setup (name, signature, addr,
+ phdr->p_memsz);
+ if (error_code < 0)
+ _dl_fatal_printf (N_("_dl_mbind failed on file %s with signature %s: error 0x%x\n"),
+ name, signature, -error_code);
+ }
+ break;
+ }
+}
+
+#define INIT_MBIND init_mbind
diff --git a/sysdeps/x86/setup-mbind.c b/sysdeps/x86/setup-mbind.c
new file mode 100644
index 0000000..626d834
--- /dev/null
+++ b/sysdeps/x86/setup-mbind.c
@@ -0,0 +1,28 @@
+/* This file is part of the GNU C Library.
+ Copyright (C) 2016 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+
+#include <setup-mbind.h>
+
+int weak_function
+__gnu_mbind_setup (const char *filename __attribute__ ((unused)),
+ const char *signature __attribute__ ((unused)),
+ void *addr __attribute__ ((unused)),
+ size_t length __attribute__ ((unused)))
+{
+ return 0;
+}
diff --git a/sysdeps/x86/setup-mbind.h b/sysdeps/x86/setup-mbind.h
new file mode 100644
index 0000000..12e3a75
--- /dev/null
+++ b/sysdeps/x86/setup-mbind.h
@@ -0,0 +1,22 @@
+/* This file is part of the GNU C Library.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stddef.h>
+
+/* Set up special memory. */
+extern int weak_function __gnu_mbind_setup (const char *, const char *,
+ void *, size_t);
diff --git a/sysdeps/x86/tst-mbind1-pie.c b/sysdeps/x86/tst-mbind1-pie.c
new file mode 100644
index 0000000..ec8c535
--- /dev/null
+++ b/sysdeps/x86/tst-mbind1-pie.c
@@ -0,0 +1,2 @@
+#define PROGRAM_NAME "tst-mbind1-pie"
+#include "tst-mbind1.c"
diff --git a/sysdeps/x86/tst-mbind1-static.c b/sysdeps/x86/tst-mbind1-static.c
new file mode 100644
index 0000000..9584073
--- /dev/null
+++ b/sysdeps/x86/tst-mbind1-static.c
@@ -0,0 +1,2 @@
+#define PROGRAM_NAME "tst-mbind1-static"
+#include "tst-mbind1.c"
diff --git a/sysdeps/x86/tst-mbind1.c b/sysdeps/x86/tst-mbind1.c
new file mode 100644
index 0000000..cf4e16d
--- /dev/null
+++ b/sysdeps/x86/tst-mbind1.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <string.h>
+#include <stdio.h>
+
+static int mbind_called;
+#ifndef PROGRAM_NAME
+# define PROGRAM_NAME "tst-mbind1"
+#endif
+
+int
+__gnu_mbind_setup (const char *filename,
+ const char *signature __attribute__ ((unused)),
+ void *addr __attribute__ ((unused)),
+ size_t length __attribute__ ((unused)))
+{
+ size_t len = strlen (filename);
+ size_t program_size = sizeof (PROGRAM_NAME);
+ if (strcmp (filename + len - program_size + 1, PROGRAM_NAME) == 0)
+ mbind_called++;
+ return 0;
+}
+
+static int
+do_test (void)
+{
+ if (mbind_called != 1)
+ {
+ printf ("__gnu_mbind_setup isn't called\n");
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+
+#include "../test-skeleton.c"
diff --git a/sysdeps/x86/tst-mbind2.c b/sysdeps/x86/tst-mbind2.c
new file mode 100644
index 0000000..da1d965
--- /dev/null
+++ b/sysdeps/x86/tst-mbind2.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <string.h>
+#include <stdio.h>
+
+static int mbind_called;
+#ifndef PROGRAM_NAME
+# define PROGRAM_NAME "tst-mbind2"
+#endif
+#ifndef PROGRAM_DSO1_NAME
+# define PROGRAM_DSO1_NAME "tst-mbind2mod.so"
+#endif
+
+extern void mbind_test (void);
+
+int
+__gnu_mbind_setup (const char *filename,
+ const char *signature __attribute__ ((unused)),
+ void *addr __attribute__ ((unused)),
+ size_t length __attribute__ ((unused)))
+{
+ size_t len = strlen (filename);
+ size_t program_size = sizeof (PROGRAM_NAME);
+ size_t program_dso1_size = sizeof (PROGRAM_DSO1_NAME);
+ if (strcmp (filename + len - program_size + 1, PROGRAM_NAME) == 0)
+ mbind_called++;
+ if (strcmp (filename + len - program_dso1_size + 1,
+ PROGRAM_DSO1_NAME) == 0)
+ mbind_called++;
+ return 0;
+}
+
+static int
+do_test (void)
+{
+ mbind_test ();
+
+ if (mbind_called != 2)
+ {
+ printf ("__gnu_mbind_setup isn't called\n");
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+
+#include "../test-skeleton.c"
diff --git a/sysdeps/x86/tst-mbind2mod.c b/sysdeps/x86/tst-mbind2mod.c
new file mode 100644
index 0000000..b1a4d35
--- /dev/null
+++ b/sysdeps/x86/tst-mbind2mod.c
@@ -0,0 +1,21 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+void
+mbind_test (void)
+{
+}
diff --git a/sysdeps/x86/tst-mbind3.c b/sysdeps/x86/tst-mbind3.c
new file mode 100644
index 0000000..6d57314
--- /dev/null
+++ b/sysdeps/x86/tst-mbind3.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+
+extern int mbind_called;
+
+static int
+do_test (void)
+{
+ if (mbind_called != 1)
+ {
+ printf ("__gnu_mbind_setup isn't called\n");
+ return 1;
+ }
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+
+#include "../test-skeleton.c"
diff --git a/sysdeps/x86/tst-mbind3mod.c b/sysdeps/x86/tst-mbind3mod.c
new file mode 100644
index 0000000..5551097
--- /dev/null
+++ b/sysdeps/x86/tst-mbind3mod.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2016 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <string.h>
+
+int mbind_called;
+#ifndef PROGRAM_NAME
+# define PROGRAM_NAME "tst-mbind3"
+#endif
+
+int
+__gnu_mbind_setup (const char *filename,
+ const char *signature __attribute__ ((unused)),
+ void *addr __attribute__ ((unused)),
+ size_t length __attribute__ ((unused)))
+{
+ size_t len = strlen (filename);
+ size_t program_size = sizeof (PROGRAM_NAME);
+ if (strcmp (filename + len - program_size + 1, PROGRAM_NAME) == 0)
+ mbind_called++;
+ return 0;
+}
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources