View previous topic :: View next topic |
Author |
Message |
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Sun Jan 01, 2006 3:02 pm Post subject: Committed files |
|
|
Ok, I've committed ArchiveLibrary.d and ArchiveLoader.d into ddl/ar
They work for my ELF loaders, and a simple test is printing all the symbols from libphobos.a
To test if it works for a COFF-library, add ArchiveLoader to the registry.
The COFF-library loader, has a section for the case where it is an import library/module. I've removed this, as I believe this possibly should be put into a COFFImportModule, although the resulting data might fit best into the archive (I don't really know, the COFF-loader don't seem to have a complete implementation). And when I say removed, I mean it is not in the ArchiveLibrary implementation, I haven't touched the coff directory.
I've also committed a minor change to ExportSymbol, adding
<code>
static const ExportSymbol NONE;
</code>
If you want to return an empty symbol somewhere, just do
<code>
return ExportSymbol.NONE;
</code>
And elsewhere you can do the
<code>
if (getExportSymbol("foo") == ExportSymbol.NONE) {
assert(0);
}
</code>
I haven't actually tested this apart from the fact that it compiles, but I've used it in C++, so hopefully it works the same Spank me if you find it silly, or not to work as intended. |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Sun Jan 01, 2006 6:08 pm Post subject: Re: Committed files |
|
|
larsivi wrote: | Ok, I've committed ArchiveLibrary.d and ArchiveLoader.d into ddl/ar
They work for my ELF loaders, and a simple test is printing all the symbols from libphobos.a
To test if it works for a COFF-library, add ArchiveLoader to the registry.
|
That's fantastic Lars. I like your implementation but there's just one catch: the references to std.stream. No worries though, we can refactor after the ELF side of things is 100?.
Quote: |
The COFF-library loader, has a section for the case where it is an import library/module. I've removed this, as I believe this possibly should be put into a COFFImportModule, although the resulting data might fit best into the archive (I don't really know, the COFF-loader don't seem to have a complete implementation). And when I say removed, I mean it is not in the ArchiveLibrary implementation, I haven't touched the coff directory.
|
I'm going to have to refactor the bejezus out of the COFF loader anyway, and I'm glad I waited for your ArchiveLoader first. I'll take your suggestion and refactor the implib stuff into COFFImportModule - I have to do some of the same .dll management for OMF anyway.
Quote: |
I've also committed a minor change to ExportSymbol, adding
<code>
static const ExportSymbol NONE;
</code> |
You probably noticed, but I got into the habit of using ExportSymbol.init instead. This is nice touch, and I'll be quick to use it! _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Mon Jan 02, 2006 1:28 am Post subject: Re: Committed files |
|
|
[quote="pragma"]
That's fantastic Lars. I like your implementation but there's just one catch: the references to std.stream. No worries though, we can refactor after the ELF side of things is 100?.
[quote]
Yes, I'm aware of this, but see my last post in the ELF Handler status thread. |
|
Back to top |
|
|
pragma
Joined: 28 May 2004 Posts: 607 Location: Washington, DC
|
Posted: Mon Jan 02, 2006 7:23 am Post subject: Re: Committed files |
|
|
larsivi wrote: | Yes, I'm aware of this, but see my last post in the ELF Handler status thread. |
Gotcha. Apart from endian-conversions not being supported on the ReadCursor, is there anything else that you feel it needs? Perhaps I should look into bringing a FileConduit/Reader implementation over into DDL? _________________ -- !Eric.t.Anderton at gmail |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Mon Jan 02, 2006 7:55 am Post subject: Re: Committed files |
|
|
pragma wrote: | larsivi wrote: | Yes, I'm aware of this, but see my last post in the ELF Handler status thread. |
Gotcha. Apart from endian-conversions not being supported on the ReadCursor, is there anything else that you feel it needs? Perhaps I should look into bringing a FileConduit/Reader implementation over into DDL? |
Hmm, actually, I just didn't like the interface Since I already had used std.stream, I had to change quite a few calls should I use ReadCursor. But since std.stream is out of the question (?), I wouldn't mind something like FileConduit.
As for the endianness, it is not very important, but I suppose that the reader might be able to do it a tad more efficient than what I currently have. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|