DOF tables are aligned according to the DOF section's alignment constraint,
so take this into account when iterating over DOF tables. PR: 195555 Submitted by: Fedor Indutny <fedor@indutny.com> (original version) MFC after: 1 week
This commit is contained in:
parent
f2e44b6029
commit
003e64df93
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276250
@ -127,6 +127,7 @@ dtrace_dof_init(void)
|
||||
int efd;
|
||||
char *s;
|
||||
size_t shstridx;
|
||||
uint64_t aligned_filesz;
|
||||
#endif
|
||||
|
||||
if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL)
|
||||
@ -183,7 +184,9 @@ dtrace_dof_init(void)
|
||||
}
|
||||
|
||||
while ((char *) dof < (char *) dofdata->d_buf + dofdata->d_size) {
|
||||
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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user