From: Allen Pais Date: Tue, 29 Mar 2016 08:50:33 +0000 (+0530) Subject: sparc64:piggback program generates a.out header with incorrect section sizes X-Git-Tag: v4.1.12-92~163^2~9 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=37af8c170011566eaa9bf91d6ac9fc39e18f0e42;p=users%2Fjedix%2Flinux-maple.git 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) --- diff --git a/arch/sparc/boot/piggyback.c b/arch/sparc/boot/piggyback.c index bb7c95161d718..76e6d4f745130 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);