Jeremy Fitzhardinge <jeremy@xxxxxxxx> writes:
No, the original crash being discussed was a GP fault in head_64.S as it tries
to initialize the kernel segments. The cause was that the prototype GDT is all
zero, even though it's an initialized variable, and inspection of vmlinux shows
that it has the right contents. But somehow it's either 1) getting zeroed on
load, or 2) is loaded to the wrong place.
The zero-based PDA mechanism requires the introduction of a new ELF segment
based at vaddr 0 which is sufficiently unusual that it wouldn't surprise me if
its triggering some toolchain bug.
Agreed. Given the previous description my hunch is that the bug is occurring
during objcopy. If vmlinux is good and the compressed kernel is bad.
It should be possible to look at vmlinux.bin and see if that was generated
properly.
Mike: what would happen if the PDA were based at 4k rather than 0? The stack
canary would still be at its small offset (0x20?), but it doesn't need to be
initialized. I'm not sure if doing so would fix anything, however.
I'm dense today. Why are we doing a zero based pda? That seems the most
likely culprit of linker trouble, and we should be able to put a smaller
offset in the segment register to allow for everything to work as expected.