Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amdahl!uunet!mcvax!unido!infbs!franzen@infbs From: franzen@infbs (Marco Franzen) Newsgroups: gnu.gcc Subject: external linkage for dumb assemblers Message-ID: <1144@infbs.UUCP> Date: 5 Feb 89 01:19:43 GMT Sender: news@infbs.UUCP Reply-To: franzen@sigserv (Marco Franzen) Organization: Informatik, Techn. Univ. Braunschweig, W. Germany Lines: 33 I am custumizing gcc 1.32 for an ns32k system. Its assembler wants .import and .export directives for symbols with global linkage, but gets confused, when I import something and define it later in the same file. But exactly this happens when I define ASM_OUTPUT_EXTERNAL and ASM_GLOBALIZE_LABEL to emit these directives. int f() { g(); } int g() {} gets .importp _g [wrong] .exportp _f _f: ... [use of g] .exportp _g _g: ... [(re)definition]. So I must sample these cases and emit the directives at the end. This could be done by a (g)awk script, but I would rather do that in cc1. (This requires a new hook ASM_FILE_END to be called.) My questions are: Is there support for similar actions in later versions of gcc? Which parts of the tree are still alive at the end of the file: Do I have to save the nodes for local declarations of extern symbols as in f(){int g(); g();}? Is there a version of gas for the ns32k? -- Marco BITNET: franzen@dbsinf6.bitnet (preferred) UUCP: franzen@infbs.uucp