Got a little curious about the usage of other linkers. Would that work? I mean, since the files are already compiled. I have only tried with visual studios linker yet and it claims it doesn't even understand the format of kernel.lib. Haven't even tried using the ones that comes with Visual Studio.
I got a little suspicious if the compiler includes a bunch of stuff that I don't need and if I somehow can force it to skip the ones I won't be using (thus also one needs to know what the builtin commands use and not). The import table contains loads and loads of api:s that I can't imagine the application is using. Even a console application containing nothing but a print "hello" has imports for CreateCompatibleDC, GetBkColor etc. Is UpdateWindow() (user32) even remotely useful as long as I only have a simple console application printing a few lines? I was under the impression that redrawing the window wasn't needed then.
Thanks for tips and opinions on this.
Hello Peter,
Every compiler uses its own format of DLL import library (.lib). You can't even use VC++ 5.0 .libs in VC++ 6.0. Which is why each compiler has its own method of creating import libraries.
As for the external references, the PRINT statement works with both the console and windows, so it contains references to the API for drawing text. If you wish to have a slightly smaller executable you can use "printf" from the Windows C dll, which is always linked against anyways. It will only save you 1.6K perhaps.
Regards,
James Sanders
Quote from: jsanders on August 05, 2008, 01:51:20 PM
Hello Peter,
Every compiler uses its own format of DLL import library (.lib). You can't even use VC++ 5.0 .libs in VC++ 6.0. Which is why each compiler has its own method of creating import libraries.
As for the external references, the PRINT statement works with both the console and windows, so it contains references to the API for drawing text. If you wish to have a slightly smaller executable you can use "printf" from the Windows C dll, which is always linked against anyways. It will only save you 1.6K perhaps.
Regards,
James Sanders
Public Support
Ionic Wind Software
Ah, ok. Is there a way to compile using another linker at all then? I know that the eb*.lib's are needed for alot, but I don't know exactly what. Guess that unless I'm using nearly 100% inline asm, I'd need those as well. I could create import libraries using the other languages (linkers) own tools before compiling, but that wouldn't help me with eb*.lib etc since they are static libraries.
To shorten things up. Can I use another linker at all, or is that just an impossible mission?
Thanks for the quick reply.
Hello Peter,
I don't know what you are trying to accomplish. Emergence uses nasm and outputs standard COFF format object files, and the static libraries should work with any linker that uses COFF format, but it won't change the references required to link with. So the final exe would still be the same size.
Regards,
James Sanders
Quote from: jsanders on August 05, 2008, 03:51:53 PM
Hello Peter,
I don't know what you are trying to accomplish. Emergence uses nasm and outputs standard COFF format object files, and the static libraries should work with any linker that uses COFF format, but it won't change the references required to link with. So the final exe would still be the same size.
Regards,
James Sanders
Public Support
Ionic Wind Software
Perfectly good questions. I'm looking for linkers with other options. Adding sections (.text2 .text3 etc) and other stuff. It's more of curiousity than a demand, but in fact I do have one project that would be a lot easier to work with if I can add more sections (or maybe just size them) in the executable.
I've just recently picked up programming "for real" again, so I'm asking whatever I can't figure out myself. Without asking or trying, I won't learn anything. :)
Thanks.
Peter,
As far as I understand sections are placed in the object files by the assembler, not the linker. Check the NASM manual (comes with Emergence, on the help menu).
As for other linkers, I know that LD from GNU binutils works with it, as I was just playing with the linux version. And there are Windows ports of LD
Regards,
James Sanders
Quote from: jsanders on August 06, 2008, 12:22:36 PM
Peter,
As far as I understand sections are placed in the object files by the assembler, not the linker. Check the NASM manual (comes with Emergence, on the help menu).
As for other linkers, I know that LD from GNU binutils works with it, as I was just playing with the linux version. And there are Windows ports of LD
Regards,
James Sanders
Public Support
Ionic Wind Software
Brilliant! Thanks for your answers. Will dig into this asap and see what I can do with it. :)