[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



drow@nevyn:~% dpkg -l gcc-2.95 binutils
Desired=Unknown/Install/Remove/Purge/Hold
|Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                 Version              Description
+++-====================-====================-========================================================
ii  gcc-2.95             2.95.4-1             The GNU C compiler.
ii  binutils             2.11.92.0.12.3-5     The GNU assembler, linker and binary utilities.
drow@nevyn:~% gcc delme.c                
delme.c: In function `main':
delme.c:12: warning: return type of `main' is not `int'
drow@nevyn:~% file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), not stripped
drow@nevyn:~% ./a.out

Please try again.

On Wed, Jan 23, 2002 at 10:20:34PM +0100, Pavel Machek wrote:
> 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
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
> 

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer



Reply to: