svn commit: r276732 - stable/10/cddl/contrib/opensolaris/lib/libdtrace/common

Mark Johnston markj at FreeBSD.org
Tue Jan 6 02:13:50 UTC 2015


Author: markj
Date: Tue Jan  6 02:13:49 2015
New Revision: 276732
URL: https://svnweb.freebsd.org/changeset/base/276732

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/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c	Tue Jan  6 02:13:48 2015	(r276731)
+++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c	Tue Jan  6 02:13:49 2015	(r276732)
@@ -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 ||


More information about the svn-src-all mailing list