Date: Tue, 25 Feb 2014 17:13:42 +0000 (UTC) From: Christian Brueffer <brueffer@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262484 - head/usr.sbin/btxld Message-ID: <201402251713.s1PHDgEY018208@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <gleb.kurtsou at gmail.com> Tested by: Ruben Kerkhof <ruben at rubenkerkhof.com> 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402251713.s1PHDgEY018208>