From owner-svn-src-all@FreeBSD.ORG Sun Apr 21 17:14:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1EB79FE2; Sun, 21 Apr 2013 17:14:51 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 110AE1A9D; Sun, 21 Apr 2013 17:14:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3LHEoUY075716; Sun, 21 Apr 2013 17:14:50 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LHEo0R075715; Sun, 21 Apr 2013 17:14:50 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304211714.r3LHEo0R075715@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 21 Apr 2013 17:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249734 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 17:14:51 -0000 Author: trociny Date: Sun Apr 21 17:14:50 2013 New Revision: 249734 URL: http://svnweb.freebsd.org/changeset/base/249734 Log: MFC r249238, r249239: r249238: 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 r249239: Fill p_flags and p_align fields of the core dump note segement. Reviewed by: kib Modified: stable/9/sys/kern/imgact_elf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/imgact_elf.c ============================================================================== --- stable/9/sys/kern/imgact_elf.c Sun Apr 21 17:13:58 2013 (r249733) +++ stable/9/sys/kern/imgact_elf.c Sun Apr 21 17:14:50 2013 (r249734) @@ -1515,8 +1515,8 @@ __elfN(puthdr)(struct thread *td, void * phdr->p_paddr = 0; phdr->p_filesz = notesz; phdr->p_memsz = 0; - phdr->p_flags = 0; - phdr->p_align = 0; + phdr->p_flags = PF_R; + phdr->p_align = sizeof(Elf32_Size); phdr++; /* All the writable segments from the program. */ @@ -1540,10 +1540,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