Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2019 18:34:23 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354822 - head/cddl/contrib/opensolaris/cmd/dtrace
Message-ID:  <201911181834.xAIIYNvU050492@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Nov 18 18:34:23 2019
New Revision: 354822
URL: https://svnweb.freebsd.org/changeset/base/354822

Log:
  Fix inconsistencies in anonymous DOF files.
  
  The DOF file output by dtrace -A contains only the loadable sections.
  However, as it was created by a call to dtrace_dof_create() without
  flags, the original DOF was created with the loadable sections.  The
  result is that the DOF includes the section headers for the unloadable
  sections (COMMENTS and UTSNAME) without these sections actually being
  present.  This is inconsistent.
  
  A simple change to anon_prog() ensures that the missing sections are
  present in the outputted DOF.  Alternatively, the call to
  dtrace_dof_create() could pass the DTRACE_D_STRIP flag stripping out the
  loadable sections.  As the unloadable sections contain info useful for
  debugging purposes they haven't been stripped.
  
  Submitted by:	Graeme Jenkinson <graeme.jenkinson@cl.cam.ac.uk>
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D21875

Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Mon Nov 18 18:25:51 2019	(r354821)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Mon Nov 18 18:34:23 2019	(r354822)
@@ -681,7 +681,7 @@ anon_prog(const dtrace_cmd_t *dcp, dof_hdr_t *dof, int
 		dfatal("failed to create DOF image for '%s'", dcp->dc_name);
 
 	p = (uchar_t *)dof;
-	q = p + dof->dofh_loadsz;
+	q = p + dof->dofh_filesz;
 
 #ifdef __FreeBSD__
 	/*



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