🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42327

gcc 2.7.0 ELF problem

#42327
From: Karsten Keil
Date: Tue, 12 Dec 1995 00:00
39 lines
1132 bytes
Hello,
if this is a FAQ sorry, but in the GCC FAQ on my CD I found nothing.
I have trouble to run xbench under linux and gcc 2.7.0 (ELF system).
It segfault's.
While debbuging it I found that a assignment of a global
variable is the reason:
...
int sync;
main ( ...


sync=0;
here is the SEGFAULT
...

I wrote a little test prog that give the same result:
/*########################*/
#include <stdio.h>

int     sync;

main(argc,argv)
    int argc;
    char **argv;
{

	sync = 0;
	printf("sync=%d\n",sync);
	
}
/*########################*/
With ELF (default) this prog segfaults,
with aout (gcc -b i486-linuxaout) it runs.

What's wrong ?
(I have an idea that sync is allready an symbol in libc, but why does it
work under aout ?).

Thanks Karsten
Technical Details
Message-ID: <DJH3J0.5s@temic-ech.spacenet.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,5ff2217ff6c2d590,start
X-Google-Attributes: gid11318c,public
From: keil@temic-ech.spacenet.de (Karsten Keil)
Subject: gcc 2.7.0 ELF problem
Date: 1995/12/12
Message-ID: <DJH3J0.5s@temic-ech.spacenet.de>
X-Deja-AN: 121609997
organization: temic
newsgroups: gnu.gcc.help