Author: delphij
Date: Thu Aug  8 07:27:49 2019
New Revision: 350744
URL: https://svnweb.freebsd.org/changeset/base/350744

Log:
  Convert DDB_CTF to use newer version of ZLIB.
  
  PR:           229763
  Submitted by: Yoshihiro Ota <ota j email ne jp>
  Differential Revision:        https://reviews.freebsd.org/D21176

Modified:
  head/sys/kern/kern_ctf.c
  head/sys/kern/link_elf.c
  head/sys/kern/link_elf_obj.c

Modified: head/sys/kern/kern_ctf.c
==============================================================================
--- head/sys/kern/kern_ctf.c    Thu Aug  8 06:30:12 2019        (r350743)
+++ head/sys/kern/kern_ctf.c    Thu Aug  8 07:27:49 2019        (r350744)
@@ -40,21 +40,7 @@
 #define CTF_HDR_STRLEN_U32     8
 
 #ifdef DDB_CTF
-static void *
-z_alloc(void *nil, u_int items, u_int size)
-{
-       void *ptr;
-
-       ptr = malloc(items * size, M_TEMP, M_NOWAIT);
-       return ptr;
-}
-
-static void
-z_free(void *nil, void *ptr)
-{
-       free(ptr, M_TEMP);
-}
-
+#include <contrib/zlib/zlib.h>
 #endif
 
 static int
@@ -269,8 +255,6 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc)
 
                /* Initialise the zlib structure. */
                bzero(&zs, sizeof(zs));
-               zs.zalloc = z_alloc;
-               zs.zfree = z_free;
 
                if (inflateInit(&zs) != Z_OK) {
                        error = EIO;

Modified: head/sys/kern/link_elf.c
==============================================================================
--- head/sys/kern/link_elf.c    Thu Aug  8 06:30:12 2019        (r350743)
+++ head/sys/kern/link_elf.c    Thu Aug  8 07:27:49 2019        (r350744)
@@ -67,10 +67,6 @@ __FBSDID("$FreeBSD$");
 
 #include <sys/link_elf.h>
 
-#ifdef DDB_CTF
-#include <sys/zlib.h>
-#endif
-
 #include "linker_if.h"
 
 #define MAXSEGS 4

Modified: head/sys/kern/link_elf_obj.c
==============================================================================
--- head/sys/kern/link_elf_obj.c        Thu Aug  8 06:30:12 2019        
(r350743)
+++ head/sys/kern/link_elf_obj.c        Thu Aug  8 07:27:49 2019        
(r350744)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/link_elf.h>
 
 #ifdef DDB_CTF
-#include <sys/zlib.h>
+#include <contrib/zlib/zlib.h>
 #endif
 
 #include "linker_if.h"
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to