How to work with gcc

(Some of an information in this section is likely to be of a historical value only. On the other hand maybe there are still some stray copies of an old gcc loader still in use. Who knows?)

A default form of executables created by this compiler is with a symbol table attached. You need to use -s flag if you really do not want it produced. A default format for TOS version of this compiler is basically the same as for Sozobon C or Alcyon. If you happen to be an owner of an old version there is one subtle difference. A bit which carries an information that a symbol is global one, known as S_EXT in parlance, is not set. This makes the debugger blind to a symbol presence.

Here are instructions how to modify an old version of a file ld.c which contains sources for gcc linker. In a function write_atari_sym(p, str) for TOS version add the following
\begin{exmpl}
\verb? if (p->n_type & N_EXT)?\\
\makebox[1.5cm]{}\verb? sym.a_type \vert= A_GLOBL;?
\end{exmpl}
just before a line which reads
\begin{exmpl}
\verb? sym.a_value = p->n_value;?
\end{exmpl}
Recompile and reinstall linker and from this moment on recognizes gcc produced symbols.

Even better idea would be to upgrade your compiler to a newer version. The modification described above will be already present, but there is more. Currently gcc, upon a presence of -G flag, may produce symbol tables with names up to twenty two characters long. Versions 1.3 and up of will correctly recognize such symbols making for much nicer debugging (even if this will require more typing from time to time). Internally this is a version of Sozobon format. Use -os flag in case of confusion.

If for some reasons you cannot upgrade, you do not have linker sources or you cannot recompile them — because you do not have enough memory, for example — not everyting is lost. It is quite feasible to disable S_EXT check in setsym() (look in the file adb1.c). You will not notice any change for Sozobon C created executables. All symbols occuring in their symbol tables are actually always global. This is not quite true for gcc and some new, sometimes strange, symbols will appear but usually this will not create any problems. In order to have only globals in a gcc produced symbol table pass -x flag either to gcc or to its linker.