🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49526

2Qs: Constructors & object format

#49526
From: Carlos M. Puchol
Date: Fri, 21 Jan 1994 06:48
48 lines
2095 bytes
Q1: Do you guys know if I can disable the generation of a call
to __main right before main() (for the contructors) at compile
time (a flag or somesuch)?

I am trying to cross compile C, but GCC keeps on generating a call

        jbsr ___main

right before executing main().

I don't have this call anywhere, nor I need it, and I would be happy if
the call to __main is gone. I'd rather not recompile the whole GCC
yet again, but I will, if I have to.

I am cross compiling in Linux to an embedded Motorla Business Card
Computer 68332 (CPU32) with my own C library (target is sun3). (But
without the library I still get the call in). The GCC info says
something about {un}defining some symbol, but I couldn't follow it.

Of course, I can put a __main(){} in every program, but it is not Kool.

Q2:

	I have a program to convert to srecords that checks for the magic
number and expects one of these:

#define	OMAGIC	0407		/* old impure format */
#define	NMAGIC	0410		/* read-only text */
#define	ZMAGIC	0413		/* demand load format */

But when it compares what the actual one has, it says:

[00:43:29](2)BamBam:test.original$ make hello
cc68 -O -I ../include -L ../lib  -c -O -I ../include -L ../lib   -c hello.c -o hello.o
ld68 -e start -N ../clib/crt0.o -L ../lib -o hello.exe hello.o -lc
rm -f hello
srec <hello.exe >hello
bad magic 100400407
make: *** [hello] Error 1
[00:43:34](2)BamBam:test.original$ 

Any clues as to what direction to follow?

Thanks a lot in advance,

Thanks,

++ Carlos
Technical Details
Message-ID: <2hntsa$jm2@thor.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,1cea04227c3dd1bb,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1994-01-21 08:21:22 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!cs.utexas.edu!not-for-mail
From: cpg@cs.utexas.edu (Carlos M. Puchol)
Newsgroups: gnu.gcc.help
Subject: 2Qs: Constructors & object format
Date: 21 Jan 1994 00:48:42 -0600
Organization: Department of Computer Sciences, UT Austin
Lines: 49
Message-ID: <2hntsa$jm2@thor.cs.utexas.edu>
NNTP-Posting-Host: thor.cs.utexas.edu