From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 17:13:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2F9A246; Tue, 25 Feb 2014 17:13:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD86710E5; Tue, 25 Feb 2014 17:13:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PHDgEX018209; Tue, 25 Feb 2014 17:13:42 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PHDgEY018208; Tue, 25 Feb 2014 17:13:42 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402251713.s1PHDgEY018208@svn.freebsd.org> From: Christian Brueffer Date: Tue, 25 Feb 2014 17:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262484 - head/usr.sbin/btxld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 17:13:42 -0000 Author: brueffer Date: Tue Feb 25 17:13:42 2014 New Revision: 262484 URL: http://svnweb.freebsd.org/changeset/base/262484 Log: In puthdr(), start the ELF .data section on a new page, as this is what btxldr expects (.set MEM_DATA,start+0x1000 in btxldr.S). This makes resulting ELF binaries bootable with grub, gptboot and boot2. PR: 153801 Submitted by: Gleb Kurtsou Tested by: Ruben Kerkhof Glanced at by: jhb, peter MFC after: 1 month Modified: head/usr.sbin/btxld/btxld.c Modified: head/usr.sbin/btxld/btxld.c ============================================================================== --- head/usr.sbin/btxld/btxld.c Tue Feb 25 17:02:11 2014 (r262483) +++ head/usr.sbin/btxld/btxld.c Tue Feb 25 17:13:42 2014 (r262484) @@ -426,7 +426,7 @@ puthdr(int fd, struct hdr *hdr) le32toh(eh.p[0].p_filesz)); eh.p[1].p_vaddr = eh.p[1].p_paddr = htole32(align(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz), - 4)); + 4096)); eh.p[1].p_filesz = eh.p[1].p_memsz = htole32(hdr->data); eh.sh[2].sh_addr = eh.p[0].p_vaddr; eh.sh[2].sh_offset = eh.p[0].p_offset;