Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Apr 2013 17:40:49 +0000 (UTC)
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r249238 - head/sys/kern
Message-ID:  <201304071740.r37HenSF033744@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trociny
Date: Sun Apr  7 17:40:49 2013
New Revision: 249238
URL: http://svnweb.freebsd.org/changeset/base/249238

Log:
  Use 4-byte padding for core dump notes on both 32 and 64bit archs.
  
  Although native word padding (i.e. 8-byte on 64bit arch) looks to be
  in agreement with standards, other parts of our code and other OSes
  use 4-byte alignment.
  
  This is not expected to change alignment for currently generated core
  dump notes, as the notes look to consist of structures with sizes
  multiple of 8 on 64-bit archs. But there are plans to add additional
  notes, where 4-byte vs 8-byte alignment makes difference.
  
  Discussed with:	kib
  Reviewed by:	kib
  MFC after:	2 weeks

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Sun Apr  7 17:06:26 2013	(r249237)
+++ head/sys/kern/imgact_elf.c	Sun Apr  7 17:40:49 2013	(r249238)
@@ -1538,10 +1538,10 @@ __elfN(putnote)(void *dst, size_t *off, 
 	*off += sizeof note;
 	if (dst != NULL)
 		bcopy(name, (char *)dst + *off, note.n_namesz);
-	*off += roundup2(note.n_namesz, sizeof(Elf_Size));
+	*off += roundup2(note.n_namesz, sizeof(Elf32_Size));
 	if (dst != NULL)
 		bcopy(desc, (char *)dst + *off, note.n_descsz);
-	*off += roundup2(note.n_descsz, sizeof(Elf_Size));
+	*off += roundup2(note.n_descsz, sizeof(Elf32_Size));
 }
 
 static boolean_t



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