Prepared the code for referencing a symbol that forces the startup code to get
linked in. git-svn-id: svn://svn.cc65.org/cc65/trunk@3976 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -385,6 +385,16 @@ void g_defimport (const char* Name, int ZP)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void g_importstartup (void)
|
||||||
|
/* Forced import of the startup segment */
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
AddTextLine ("\t.forceimport\t__STARTUP_RUN__");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void g_importmainargs (void)
|
void g_importmainargs (void)
|
||||||
/* Forced import of a special symbol that handles arguments to main */
|
/* Forced import of a special symbol that handles arguments to main */
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -153,6 +153,9 @@ void g_defexport (const char* Name, int ZP);
|
|||||||
void g_defimport (const char* Name, int ZP);
|
void g_defimport (const char* Name, int ZP);
|
||||||
/* Import the given label */
|
/* Import the given label */
|
||||||
|
|
||||||
|
void g_importstartup (void);
|
||||||
|
/* Forced import of the startup segment */
|
||||||
|
|
||||||
void g_importmainargs (void);
|
void g_importmainargs (void);
|
||||||
/* Forced import of a special symbol that handles arguments to main */
|
/* Forced import of a special symbol that handles arguments to main */
|
||||||
|
|
||||||
|
|||||||
@@ -381,6 +381,11 @@ void NewFunc (SymEntry* Func)
|
|||||||
Error ("`main' must always return an int");
|
Error ("`main' must always return an int");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add a forced import of a symbol that is contained in the startup
|
||||||
|
* code. This will force the startup code to be linked in.
|
||||||
|
*/
|
||||||
|
g_importstartup ();
|
||||||
|
|
||||||
/* If main() takes parameters, generate a forced import to a function
|
/* If main() takes parameters, generate a forced import to a function
|
||||||
* that will setup these parameters. This way, programs that do not
|
* that will setup these parameters. This way, programs that do not
|
||||||
* need the additional code will not get it.
|
* need the additional code will not get it.
|
||||||
|
|||||||
Reference in New Issue
Block a user