diff options
author | brueffer <brueffer@FreeBSD.org> | 2014-02-25 17:13:42 +0000 |
---|---|---|
committer | brueffer <brueffer@FreeBSD.org> | 2014-02-25 17:13:42 +0000 |
commit | a73cae56879668d8cb4dd40a95d4a1bfd5df85e9 (patch) | |
tree | 910d6a96d251cf14e51759debaa8149ea2a1223e /usr.sbin/btxld | |
parent | ed49704845bb5de16b8f706c1cf643fce9c92f76 (diff) | |
download | FreeBSD-src-a73cae56879668d8cb4dd40a95d4a1bfd5df85e9.zip FreeBSD-src-a73cae56879668d8cb4dd40a95d4a1bfd5df85e9.tar.gz |
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
Diffstat (limited to 'usr.sbin/btxld')
-rw-r--r-- | usr.sbin/btxld/btxld.c | 2 |
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; |