Is there no option to these tools to pad the input file accordingly?
Your github repo does not contain build instructions of any sort, so I don't know how you are creating the kernel. But no, the ELF file does not have to be a multiple of 4kB in size. The last thing the linker script does is to pad the BSS section to a 4kB boundary, but BSS is not stored in the file. Perhaps the file was meant to be dumped into binary form before being used? That can be done with
Code:
objcopy -O binary kernel7.elf kernel7.bin
Many kernels use this trick, in embedded development and elsewhere. I personally dislike it, but there are cases where it is needed. Such as when running without a loader capable of loading an ELF file.