]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64:piggback program generates a.out header with incorrect section sizes
authorAllen Pais <allen.pais@oracle.com>
Tue, 29 Mar 2016 08:50:33 +0000 (14:20 +0530)
committerAllen Pais <allen.pais@oracle.com>
Tue, 19 Apr 2016 12:31:49 +0000 (18:01 +0530)
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 <jose.marchesi@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
(cherry picked from commit bd99ee7ceffb1a472ccd8841dd7011d15e7fa258)

arch/sparc/boot/piggyback.c

index bb7c95161d7188f5defd780ddec934b0395b48b0..76e6d4f7451301562f684acb974d132841579302 100644 (file)
@@ -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);