Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/libsanitizer/interception the interce...



details:   https://anonhg.NetBSD.org/src/rev/5a18ef1b7e87
branches:  trunk
changeset: 803313:5a18ef1b7e87
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 22 00:15:16 2014 +0000

description:
the interceptors don't know about __RENAME() so add a kludge.

diffstat:

 external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc |  15 ++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 83dfaafb6f34 -r 5a18ef1b7e87 external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc
--- a/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc    Wed Oct 22 00:14:52 2014 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/interception/interception_linux.cc    Wed Oct 22 00:15:16 2014 +0000
@@ -16,9 +16,24 @@
 #include <stddef.h>  // for NULL
 #include <dlfcn.h>   // for dlsym
 
+#ifdef __NetBSD__
+static int mystrcmp(const char *s1, const char *s2) {
+  while (*s1 == *s2++)
+    if (*s1++ == 0)
+      return (0);
+  return (*(const unsigned char *)s1 - *(const unsigned char *)--s2);
+}
+#endif
+
+
 namespace __interception {
 bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
     uptr real, uptr wrapper) {
+#ifdef __NetBSD__
+  // XXX: Until I come up with something better to deal with renames.
+  if (mystrcmp(func_name, "sigaction") == 0)
+    func_name = "__sigaction14";
+#endif
   *func_addr = (uptr)dlsym(RTLD_NEXT, func_name);
   return real == wrapper;
 }



Home | Main Index | Thread Index | Old Index