From 65d2ce717ec9385131ce56c21bdc74253aa6ae19 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 2 Jun 2018 22:58:44 +0100 Subject: [PATCH] binman: generate valid binaries for high memory --- Library/tools/binman.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Library/tools/binman.c b/Library/tools/binman.c index 14694d36..e1cf81ae 100644 --- a/Library/tools/binman.c +++ b/Library/tools/binman.c @@ -95,8 +95,15 @@ int main(int argc, char *argv[]) } memcpy(buf + s__INITIALIZED, buf + s__INITIALIZER, l__INITIALIZER); + if (progload & 0xFF) { + fprintf(stderr, "%s: load address must be page aligned.\n", argv[0]); + exit(1); + } - bp = buf + progload + 10; + bp = buf + progload + 7; + *bp++ = progload >> 8; + *bp++ = 0; + *bp++ = 0; *bp++ = s__INITIALIZED - progload; *bp++ = (s__INITIALIZED - progload) >> 8; *bp++ = s__DATA - s__INITIALIZED; -- 2.34.1