summaryrefslogtreecommitdiffstats
path: root/usr.sbin/btxld
diff options
context:
space:
mode:
authorbrueffer <brueffer@FreeBSD.org>2014-03-27 20:19:11 +0000
committerbrueffer <brueffer@FreeBSD.org>2014-03-27 20:19:11 +0000
commit91720dd7bb5ed5ec2827786ecd5d97e28f0c93d6 (patch)
tree39e7b66176a31a0625392647d223360aae6d0ef0 /usr.sbin/btxld
parentaf75007ff31865916cc75c3f72d571b42221f003 (diff)
downloadFreeBSD-src-91720dd7bb5ed5ec2827786ecd5d97e28f0c93d6.zip
FreeBSD-src-91720dd7bb5ed5ec2827786ecd5d97e28f0c93d6.tar.gz
MFC: r262484
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
Diffstat (limited to 'usr.sbin/btxld')
-rw-r--r--usr.sbin/btxld/btxld.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/btxld/btxld.c b/usr.sbin/btxld/btxld.c
index 1102b5c..7984c4c 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;
OpenPOWER on IntegriCloud