TCC: Add -nobss option to not include BSS sections in output file.

git-svn-id: svn://kolibrios.org@8154 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
2020-11-06 20:02:56 +00:00
parent 9c0ca4f346
commit 0fe740bca1
6 changed files with 162 additions and 151 deletions

View File

@@ -1890,7 +1890,7 @@ static char *copy_linker_arg(const char *p)
/* set linker options */
static int tcc_set_linker(TCCState *s, const char *option)
{
{
while (option && *option) {
const char *p = option;
@@ -2038,7 +2038,8 @@ enum {
TCC_OPTION_MD,
TCC_OPTION_MF,
TCC_OPTION_x,
TCC_OPTION_stack
TCC_OPTION_stack,
TCC_OPTION_nobss
};
#define TCC_OPTION_HAS_ARG 0x0001
@@ -2100,6 +2101,7 @@ static const TCCOption tcc_options[] = {
{ "MF", TCC_OPTION_MF, TCC_OPTION_HAS_ARG },
{ "x", TCC_OPTION_x, TCC_OPTION_HAS_ARG },
{ "stack", TCC_OPTION_stack, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP},
{ "nobss", TCC_OPTION_nobss, 0 },
{ NULL, 0, 0 },
};
@@ -2428,9 +2430,12 @@ ST_FUNC int tcc_parse_args1(TCCState *s, int argc, char **argv)
/* ignored */
break;
case TCC_OPTION_stack:
#ifdef TCC_TARGET_MEOS
s->pe_stack_size = strtoul(optarg+1, NULL, 10);
#endif
#ifdef TCC_TARGET_MEOS
s->pe_stack_size = strtoul(optarg+1, NULL, 10);
#endif
break;
case TCC_OPTION_nobss:
s->nobss = 1;
break;
default:
if (s->warn_unsupported) {