The MASM Forum Archive 2004 to 2012

Specialised Projects => Compiler Based Assembler => Pelle's C compiler and tools => Topic started by: Vortex on March 20, 2005, 12:25:19 PM

Title: Small DLLs without C startup code
Post by: Vortex on March 20, 2005, 12:25:19 PM
Hi friends,

Here is an example of creating DLLs with smaller size. No C startup code.

[attachment deleted by admin]
Title: Re: Small DLLs without C startup code
Post by: James Ladd on June 30, 2006, 03:47:32 AM
Vortex,

This is really neat work.
Can you post what is going on, ie: how are you making the DLL's small and what size are
they without using your approach ?

Rgs, James.
Title: Re: Small DLLs without C startup code
Post by: zooba on June 30, 2006, 08:29:21 AM
Basically, he's not including the C library (AFAICT) and is providing his own entry point, much like how we do DLLs in assembly.

The PPJ files have all the build options in them, just open them in notepad/QEditor.

Cheers,

Zooba :U
Title: Re: Small DLLs without C startup code
Post by: Vortex on June 30, 2006, 10:09:32 AM
Hi James,

Zooba's explanation is correct, the trick is to exclude the standart C run-time library supplied with the compiler package and define your own entry point. Back home, I will give you information about file size comparaison.
Title: Re: Small DLLs without C startup code
Post by: James Ladd on June 30, 2006, 11:05:17 PM
Vortex,
Thanks.
Im wondering what size difference it makes so when you know the normal size of
a DLL that would be great.
Rgs, James.
Title: Re: Small DLLs without C startup code
Post by: Vortex on July 02, 2006, 09:25:03 AM
According to the test results with Pelles C V4.50 Beta 3 :

normal size                  = 8704 bytes
without C startup code  = 3072 bytes

[attachment deleted by admin]
Title: Re: Small DLLs without C startup code
Post by: James Ladd on July 02, 2006, 10:10:24 PM
Thats great.
Do you know how to do this or do I need to do it for a Linux sharable object ?
Title: Re: Small DLLs without C startup code
Post by: Vortex on July 03, 2006, 05:25:41 AM
Hi James,

Sorry, I am not a Linux user so I don't know if this trick works for Linux.
Title: Re: Small DLLs without C startup code
Post by: James Ladd on July 03, 2006, 09:37:17 PM
Vortex,

Given the simplicity of the approach im thinking it might work.
I'll ask around the other forums and if I find out Ill post here.

Rgs, James.
Title: Re: Small DLLs without C startup code
Post by: zooba on July 04, 2006, 02:59:40 AM
Once you use a function from the C library chances are you're going to include most of that bloat back in anyway. I prefer to pick a single (general-purpose) library and use it completely, rather than picking and choosing from multiple ones (unless they're single-purpose, ie. compressing, image loaders, etc.)