There is logic in ELF loadimage() to relocate kernels, but currently
only type ET_EXEC. PowerPC kernels are ET_DYN, and can be relocated anywhere.
Add the load offset to kernel entry points on this platform.
Details
- Reviewers
imp • ian - Commits
- rS351920: Loader: Add load offset to powerpc kernel entry point
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
stand/common/load_elf.c | ||
---|---|---|
484 ↗ | (On Diff #60867) | Look above and you see this block is for type ET_EXEC. PowerPC kernels are ET_DYN now. This block looks really weird, and I would love to remove it. Not sure if we can, though, because I don't know if any "supported" older release kernels are being booted with a modern loader. Otherwise, yes, I could muck with the condition above and muck with this as well. Or completely remove this block for PowerPC, and do the work below where I added, only. |
stand/common/load_elf.c | ||
---|---|---|
520 ↗ | (On Diff #60867) | Okay, that's two of us who thought this needed to move up. We were wrong, but clearly the current code structure is going to fool people. Maybe it would be better to move this block up so that the overall structure is: if (ehdr->e_type == ET_DYN) { #ifdef powerpc // new stuff #endif } else if (ehdr->e_type == ET_EXEC) { // existing stuff } |
stand/common/load_elf.c | ||
---|---|---|
480 ↗ | (On Diff #61515) | I don't think this block should really be here, but I'm not sure enough to remove it. Since the current idea is that we typically load in the first 256MB, I don't see a problem enough to fix it. |
stand/common/load_elf.c | ||
---|---|---|
520 ↗ | (On Diff #60867) | or just make it an else if here for the new stuff. but why then is this powerpc specific if other platforms aren't currently doing it? Will there be harm to them? |