From 419749b63a2c4d26283c95d7135a2629cdebc149 Mon Sep 17 00:00:00 2001 From: Christian Brueffer Date: Tue, 25 Feb 2014 17:13:42 +0000 Subject: [PATCH] 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 --- usr.sbin/btxld/btxld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/btxld/btxld.c b/usr.sbin/btxld/btxld.c index 1102b5c0f271..7984c4cd31df 100644 --- a/usr.sbin/btxld/btxld.c +++ b/usr.sbin/btxld/btxld.c @@ -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;