From 37af8c170011566eaa9bf91d6ac9fc39e18f0e42 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Tue, 29 Mar 2016 14:20:33 +0530 Subject: [PATCH] sparc64:piggback program generates a.out header with incorrect section sizes piggyback in uek for SPARC generates an a.out that has section sizes that are too large. This causes problems when booting with OpenBoot because OpenBoot uses those sizes to map and copy the image to its specified VA and runs into unmapped memory during the copies. This is a minimal fix. Orabug:21793535 Signed-off-by: Jose Marchesi Signed-off-by: Allen Pais (cherry picked from commit bd99ee7ceffb1a472ccd8841dd7011d15e7fa258) --- arch/sparc/boot/piggyback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/boot/piggyback.c b/arch/sparc/boot/piggyback.c index bb7c95161d71..76e6d4f74513 100644 --- a/arch/sparc/boot/piggyback.c +++ b/arch/sparc/boot/piggyback.c @@ -246,7 +246,7 @@ int main(int argc,char **argv) if (lseek(image, 4, 0) < 0) die("lseek"); /* a_text */ - st4(buffer, align(end + 32 + 8191) - (start & ~0x3fffffUL) + + st4(buffer, align(end + 32) - (start & ~0x3fffffUL) + s.st_size); /* a_data */ st4(buffer + 4, 0); -- 2.50.1