Einzelnen Beitrag anzeigen

mr_emre_d
(Gast)

n/a Beiträge
 
#7

Re: Delphi Programme ~ 1kb

  Alt 6. Apr 2009, 15:22
Zitat von himitsu:
nee nee, der Linker ist schon intelligent genug ... Problem ist der Initialisations/Finalisations-Abschnitt ... alles was darin verwendet wird, wird auch gelinkt ... und das ist vorallem in SysUtils eine ganze Menge
Naja:
Delphi-Quellcode:
SYSINIT:

unit SysInit;

interface
procedure _InitExe;
procedure _halt0;
procedure _InitLib(Context: PinitContext);

var
ModulelsLib: Boolean;
TlsIndex: Integer = -1;
TlsLast: Byte;

const
PtrToNil: Pointer = nil;


implementation

procedure _InitLib(Context: PinitContext);
asm
end;

procedure _InitExe;
asm
end;

procedure _halt0;
asm
end;

end.

SYSTEM:

unit System;

interface

procedure _HandleFinally;

type
TGUID = record
D1: LongWord;
D2: Word;
D3: Word;
D4: array[0..7] of Byte;
end;

PInitContext = ^TInitContext;
TInitCOntext = record

OuterContext: PInitContext;
ExcFrame: Pointer;
InitTable: Pointer;
InitCount: Integer;
Module: Pointer;
DLLSaveEBP: Pointer;
DLLSaveEBX: Pointer;
DLLSaveESI: Pointer;
DLLSaveEDI: Pointer;
ExitProcessTLS: procedure;
DLLInitState: Byte;
end;

implementation


procedure _HandleFinally;
asm
end;

end.
ist nicht viel :S

Wenn man diese Units verwendet, ändert sich nichts großartig ander Größe (~10kb)
  Mit Zitat antworten Zitat