Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 2019 07:27:50 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350744 - head/sys/kern
Message-ID:  <201908080727.x787RofB017071@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908080727.x787RofB017071>