Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jan 2015 02:13:49 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r276731 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common
Message-ID:  <201501060213.t062DnGv091070@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Jan  6 02:13:48 2015
New Revision: 276731
URL: https://svnweb.freebsd.org/changeset/base/276731

Log:
  MFC r276250:
  DOF tables are aligned according to the DOF section's alignment constraint,
  so take this into account when iterating over DOF tables.
  
  PR:	195555

Modified:
  stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)
  stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c	Tue Jan  6 02:08:45 2015	(r276730)
+++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c	Tue Jan  6 02:13:48 2015	(r276731)
@@ -163,6 +163,7 @@ dtrace_dof_init(void)
 	size_t shstridx, symtabidx = 0, dynsymidx = 0;
 	unsigned char *buf;
 	int fixedprobes;
+	uint64_t aligned_filesz;
 #endif
 
 	if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL)
@@ -226,7 +227,9 @@ dtrace_dof_init(void)
 
 	while ((char *) dof < (char *) dofdata->d_buf + dofdata->d_size) {
 		fixedprobes = 0;
-		dof_next = (void *) ((char *) dof + dof->dofh_filesz);
+		aligned_filesz = (shdr.sh_addralign == 0 ? dof->dofh_filesz :
+		    roundup2(dof->dofh_filesz, shdr.sh_addralign));
+		dof_next = (void *) ((char *) dof + aligned_filesz);
 #endif
 
 	if (dof->dofh_ident[DOF_ID_MAG0] != DOF_MAG_MAG0 ||



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