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)
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);