[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PowerPC C++ kernel woes.
From: |
Andrei Warkentin |
Subject: |
PowerPC C++ kernel woes. |
Date: |
Sat, 26 Nov 2005 18:42:36 -0600 |
Hello,
I've been trying to get some C++ running (now that I can print "Hello
World" from OF, I'd like to move my "Hello World" C++ kernel to
PowerPC), but it has been without much success.
I've finally figured out that there are these small data sections
which I was not taking care of in my ld script (sdata, sbss, sdata2,
sbss2). Prior to me figuring this out, I would get a crash. After I
added these sections, I've noticed several globals appear in .sbss
(using powerpc-linux-nm to see all syms), but now I get CLAIM failed
while loading my kernel in OF. Odd.
So I guess I have several questions:
Am I doing something wrong w.r.t sdata, sbss, sbss2, and sdata2
in my ld script? I am also not sure as to how these should be
aligned, if at all.
What about _SDA_BASE_ and _SDA_BASE2_? AFAIK, these should point
in the middle of the sdata+sbss and sdata2+sbss2. Should I load r13
and r14 with these values?
So far my code doesn't appear to use either register.
I 've been doing this for SDA_BASE and SDA2_BASE
PROVIDE (_SDA_BASE_ = ld_sdata + ((ld_sbss_end - ld_sdata) / 2));
PROVIDE (_SDA2_BASE_ = ld_sdata2 + ((ld_sbss2_end - ld_sdata2) / 2));
... but the linker seems to ignore my values and gives
0020f000 G _SDA_BASE_
00210000 G _SDA2_BASE_
( kernel linked @ 2MB, same way as I linked my C hello world example,
which works just fine).
Thanks and have a great day.
/* The sdata section. */
.sdata ALIGN(0x1000): {
ld_sdata = .;
/* SData. */
*(.sdata)
*(.gnu.linkonce.s.*)
ld_sdata_end = .;
}
.sbss : {
ld_sbss = .;
/* BSS. */
*(.sbss)
*(.scommon)
ld_sbss_end = .;
}
/* The sdata2 section. */
.sdata2 ALIGN(0x1000): {
ld_sdata2 = .;
/* SData2. */
*(.sdata2)
*(.gnu.linkonce.s2.*)
ld_sdata2_end = .;
}
/* The SBSS2 section. */
.sbss2 : {
ld_sbss2 = .;
/* SBSS2. */
*(.sbss2)
*(.gnu.linkonce.sb2.*)
ld_sbss2_end = .;
}
- PowerPC C++ kernel woes.,
Andrei Warkentin <=