Skip to content

Instantly share code, notes, and snippets.

@calio
Created December 23, 2015 18:52
Show Gist options
  • Save calio/8f7278394d0125814580 to your computer and use it in GitHub Desktop.
Save calio/8f7278394d0125814580 to your computer and use it in GitHub Desktop.
Stock cflow doesn't allow static symbol to be main function using '-m' argument, this fixed that.
diff --git a/src/symbol.c b/src/symbol.c
index 567e458..2810540 100644
--- a/src/symbol.c
+++ b/src/symbol.c
@@ -131,6 +131,8 @@ install(char *name, int flags)
void
ident_change_storage(Symbol *sp, enum storage storage)
{
+ if (!strcmp(sp->name, start_name))
+ storage = ExternStorage;
if (sp->storage == storage)
return;
if (sp->storage == StaticStorage)
@ngoctint1lvc
Copy link

Really helpful, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment