aboutsummaryrefslogtreecommitdiff
path: root/tcc.c
diff options
context:
space:
mode:
authorgrischka <grischka>2017-04-04 08:34:52 +0200
committergrischka <grischka>2017-04-04 08:34:52 +0200
commit536ed76d5a69d8e3c0e247d6557f5942818cb253 (patch)
treed3cf8de45fcc8493fb7f9acd5239e63ec4a7b92e /tcc.c
parentc4c3f5009e086b2eca472f61b99da1ade6d33286 (diff)
downloadtinycc-536ed76d5a69d8e3c0e247d6557f5942818cb253.tar.gz
tinycc-536ed76d5a69d8e3c0e247d6557f5942818cb253.tar.bz2
tccgen/win32: let __declspec(dllimport) imply extern
Also, retain storage qualifiers in type_decl, in particular also for function pointers. This allows to get rid of this very early hack in decl() type.t |= (btype.t & VT_STATIC); /* Retain "static". */ which was to fix the case of int main() { static int (*foo)(); ... Also: - missing __declspec(dllimport) is an error now - except if the symbol is "_imp__symbol" - demonstrate export/import of data in the dll example (while 'extern' isn't strictly required with dllimport anymore) - new function 'patch_storage()' replaces 'weaken_symbol()' and 'apply_visibility()' - new function 'update_storage()' applies storage attributes to Elf symbols. - put_extern_sym/2 accepts new pseudo section SECTION_COMMON - add -Wl,-export-all-symbols as alias for -rdynamic - add -Wl,-subsystem=windows for mingw compatibility - redefinition of 'sym' error for initialized global data
Diffstat (limited to 'tcc.c')
-rw-r--r--tcc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tcc.c b/tcc.c
index 2cca7a8..9ae84fc 100644
--- a/tcc.c
+++ b/tcc.c
@@ -117,13 +117,14 @@ static const char help2[] =
"-Wl,... linker options:\n"
" -nostdlib do not link with standard crt/libs\n"
" -[no-]whole-archive load lib(s) fully/only as needed\n"
+ " -export-all-symbols same as -rdynamic\n"
" -image-base= -Ttext= set base address of executable\n"
" -section-alignment= set section alignment in executable\n"
#ifdef TCC_TARGET_PE
" -file-alignment= set PE file alignment\n"
" -stack= set PE stack reserve\n"
" -large-address-aware set related PE option\n"
- " -subsystem=[console gui] set PE subsystem\n"
+ " -subsystem=[console/windows] set PE subsystem\n"
" -oformat=[pe-* binary] set executable output format\n"
"Predefined macros:\n"
" tcc -E -dM - < nul\n"