June 26, 2024, 05:47:09 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Other linkers, will that work?

Started by Peter, August 05, 2008, 11:36:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Peter

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.

jsanders

August 05, 2008, 01:51:20 PM #1 Last Edit: August 30, 2010, 08:49:05 PM by Larry McCaughn
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

Peter

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.

jsanders

August 05, 2008, 03:51:53 PM #3 Last Edit: August 30, 2010, 08:48:46 PM by Larry McCaughn
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



Peter

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.

jsanders

August 06, 2008, 12:22:36 PM #5 Last Edit: August 30, 2010, 08:48:27 PM by Larry McCaughn
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

Peter

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. :)