fix zero BSS segments

git-svn-id: svn://kolibrios.org@6858 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl 2017-02-06 19:46:12 +00:00
parent 4e23975970
commit 80c223b078
2 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
CC = kos32-gcc
LD = kos32-ld
SDK_DIR:= $(abspath ../../../sdk)
SDK_DIR:= $(abspath ../../../contrib/sdk)
#gcc 4.8
#LDFLAGS = -static -nostdlib -T $(SDK_DIR)/sources/newlib/static.lds

View File

@ -274,7 +274,14 @@ int tcc_output_me(TCCState* s1,const char *filename)
for (si=me.data_sections;si;si=si->next)
fwrite(si->data,1,si->data_size,f);
for (si=me.bss_sections;si;si=si->next)
{
if (si->data == NULL)
{
// printf("\nError! BSS data is NULL! size:%i",(int)si->data_size);
si->data = calloc(si->data_size, 1);
}
fwrite(si->data, 1, si->data_size, f);
}
/*
if (me.bss_sections) // Siemargl testin, what we lose
{