diff options
Diffstat (limited to 'sys/boot/uboot/lib/copy.c')
-rw-r--r-- | sys/boot/uboot/lib/copy.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/boot/uboot/lib/copy.c b/sys/boot/uboot/lib/copy.c index bb658e3..51416ac 100644 --- a/sys/boot/uboot/lib/copy.c +++ b/sys/boot/uboot/lib/copy.c @@ -118,6 +118,13 @@ uboot_loadaddr(u_int type, void *data, uint64_t addr) this_block = eubldr; this_size = eblock - eubldr; } + } else if (subldr < sblock && eubldr < eblock) { + /* Loader is below or engulfs the sblock */ + this_block = (eubldr < sblock) ? sblock : eubldr; + this_size = eblock - this_block; + } else { + this_block = 0; + this_size = 0; } if (biggest_size < this_size) { biggest_block = this_block; |