[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] TCC and "smart" linking
From: |
Oleg N. Cher |
Subject: |
[Tinycc-devel] TCC and "smart" linking |
Date: |
Tue, 09 Oct 2012 16:19:43 +0300 |
User-agent: |
Thunderbird 2.0.0.19 (Windows/20081209) |
Dear TCC developers,
I very like TCC. The Internet had an opinion of TCC as about producing very
compact code. To this view continues to be, very important to add to TCC the
functionality of smart linking, as in Turbo Pascal:
"Turbo Pascal first marks all symbol table blocks </marking-used-blocks> for variables, typed constants, procedures and code blocks as unused, then it iterates through
all modules and marks used blocks </marking-used-blocks> starting from the main program, after that it calculates code offsets </calculating-offsets-of-code-blocks>, variable offsets </calculating-offsets-of-variables>, resolves references </resolving-references>, and finally, it writes code to either overlay file or to the executable file </creating-executable-file>."
**http://turbopascal.org/linking-modules-and-creating-exe-file**
For demonstrate the lack of this feature in TCC, I tried to compile this code
(in TCC 0.9.25 for Win32):
#include <Windows.h>
void Unused (void)
{
Beep(100, 100);
}
int main (int argc, char **argv)
{
return 0;
}
The function Unused is really unused, but it's included to target EXE file.
The same be, if mark Unused as 'static'. The same be, if Unused is compiled
earlier and added from object file (*.o)
Maybe there is a way in TCC to put fucntion Unused to a library, and it be
linked to the target EXE/DLL, if only need?
Also I would like to download TCC-Win64 for target Win64 and TCC-Win32 for
target Win64 ready-builded, if possible. Beta vers. are good too.
Thank you!
Oleg N. Cher,
VEDAsoft Oberon Club
http://zx.oberon2.ru
- [Tinycc-devel] TCC and "smart" linking,
Oleg N. Cher <=