[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Fwd: evbarm ldscript vs. KERNEL_BASE_PHYS != KERNEL_BASE_VIRT
Oops, I guess there isn't a separate evbarm list; forwarding here.
--- Begin Message ---
If I build a kernel where KERNEL_BASE_PHYS != KERNEL_BASE_VIRT, the BSS
ends up having it's (ELF) physaddr set to one based at KERNEL_BASE_VIRT
instead of KERNEL_BASE_PHYS. This seems like a bug to me and it makes
it hard for me to correctly load such a kernel, since my loader tries
to zero memory that's likely unmapped at the time.
Diff that fixes it for me is below; I thought I'd pass this by the list
for feedback since I'm far from an ARM gooroo.
(For the people on the hpcarm list, this is related to the hpcboot fix
I sent there -- hpcboot needs to understand to load at physaddr vs.
RCS file: /cvsroot/src/sys/arch/evbarm/conf/ldscript.evbarm,v
retrieving revision 1.3
diff -u -p -r1.3 ldscript.evbarm
--- conf/ldscript.evbarm 23 May 2003 00:57:27 -0000 1.3
+++ conf/ldscript.evbarm 10 Mar 2008 19:26:03 -0000
@@ -47,6 +47,7 @@ SECTIONS
__bss_start = .;
__bss_start__ = .;
+ AT (LOADADDR(.sdata) + (ADDR(.sbss) - ADDR(.sdata)))
PROVIDE (__sbss_start = .);
PROVIDE (___sbss_start = .);
@@ -58,6 +59,7 @@ SECTIONS
PROVIDE (___sbss_end = .);
+ AT (LOADADDR(.sbss) + (ADDR(.bss) - ADDR(.sbss)))
Time is an illusion; lunchtime, doubly so. |/\/\| Rafal Boni
-- Ford Prefect |\/\/|
--- End Message ---
Main Index |
Thread Index |