POD
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Fri Dec 29 12:38:04 PST 2006
Aleksey S. Skidan wrote:
> What it's all about is that I wanted to port my kernel from C++ into D. With C++
> it's an easy task. Just turn off ABI-dependent stuff. With D it's not that story.
> I can't turn off RTTI for ex. Thus I can't compile my kernel not implementing
> object.d from ABI. And that's not good. I don't want to have extra needless data
> in my data section. The data I will never use!
As I've said before, object.d isn't hard to port. The version for my
kernel has minimal modifications.
If you're using ld, just pass --gc-sections on the command line to
remove unreferenced data and code[1]...
[1]: Caveat: you may need to modify your linker script to use KEEP()
around sections containing any multiboot headers or other things not
referenced directly from the code, to make sure they don't get thrown away.
That includes .ctor* and .dtor* sections, if you use static this(),
static ~this() or unittest{} blocks in your code and expect the
ModuleInfo linked list with their info to be built like in Phobos on Linux.
More information about the Digitalmars-d
mailing list