Article View: gnu.gcc.help
Article #51150ASM_OUTPUT_EXTERNAL - help!
From: David Alan Gilbert
Date: Mon, 05 Jul 1993 13:08
Date: Mon, 05 Jul 1993 13:08
44 lines
1815 bytes
1815 bytes
I'm trying to rewrite a backend for a non-unix style assembler, the strange
thing in particular with this assembler is the way in which external symbols
are handled. In particular I must have a
IMPORT symbol
line before an external symbol (say printf) , but if a function is declared
later in the file there MUST be no such directive.
e.g.
#include <stdio.h>
void a(void);
void main(int argc,char *argv[]) {
a();
}
void a(void) {
printf("hello world");
}
This needs an
IMPORT printf
line before use , but it MUST NOT have an
IMPORT a
line. What I did was to write a simple ASM_OUTPUT_EXTERNAL which
just did
fputs ("\tIMPORT ",FILE); \
assemble_name (FILE, NAME); \
but in the example above this also produces an 'IMPORT a' directive.
So theres obviously something which I need to test first, I've tried
TREE_CODE(DECL) which gives function_decl for both cases, TREE_ADDRESSABLE,
STATIC,PUBLIC,ASM_WRITTEN and |USED are all the same in both cases.
Any suggestions - PLEASE!
Dave
--
-------------------------------------------------------------------------------
- David Alan Gilbert - gilbertd@cs.man.ac.uk - G7FHJ@GB7CRG -
------(Programmers don't sleep - they just park their heads)-------------------
Technical Details
Message-ID:
<gilbertd.741877716@cs.man.ac.uk>Path:
arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!news.dfn.de!darwin.sura.net!haven.umd.edu!uunet!pipex!warwick!uknet!mucs!cs.man.ac.uk!gilbertdShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,f3c11ad2a2992c07,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-07-05 17:09:21 PST Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!news.dfn.de!darwin.sura.net!haven.umd.edu!uunet!pipex!warwick!uknet!mucs!cs.man.ac.uk!gilbertd From: gilbertd@cs.man.ac.uk (David Alan Gilbert) Newsgroups: gnu.gcc.help Subject: ASM_OUTPUT_EXTERNAL - help! Message-ID: <gilbertd.741877716@cs.man.ac.uk> Date: 5 Jul 93 13:08:36 GMT Sender: news@cs.man.ac.uk Lines: 44