[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#130591: gcc: gcc produces broken executable big static arrays are in use



Package: gcc
Version: 2:2.95.4-9
Severity: normal


-- System Information
Debian Release: 3.0
Kernel Version: Linux amd 2.5.2 #92 Sun Jan 20 23:25:47 CET 2002 i686 unknown

Versions of the packages gcc depends on:
ii  cpp            2.95.4-9       The GNU C preprocessor.
ii  cpp-2.95       2.95.4-0.01100 The GNU C preprocessor.
ii  gcc-2.95       2.95.4-0.01100 The GNU C compiler.


gcc produces _statically linked_ executable even if not asked for, and
the executable is b0rken.

pavel@amd:~/sf/nltools/slm$ cat delme.c

struct foo {
  void *hash[6000000];
  void *hash2[6000000];
  void *hash3[6000000];
  void *hash4[60000000];
};

struct foo a;

void
main(void)
{
}
pavel@amd:~/sf/nltools/slm$ gcc delme.c
delme.c: In function `main':
delme.c:13: warning: return type of `main' is not `int'
pavel@amd:~/sf/nltools/slm$ ldd a.out
        not a dynamic executable
pavel@amd:~/sf/nltools/slm$ gcc --version
2.95.4
pavel@amd:~/sf/nltools/slm$

If hash4 array is 10 times smaller, everything behaves okay. What is
worse, resulting binary (of bigger project) is broken, and gdb crashes
on that.
								Pavel



Reply to: