On Mon, Jan 15, 2007 at 07:35:22PM -0800, Ian Lance Taylor wrote:
> "H. J. Lu" <[EMAIL PROTECTED]> writes:
> 
> > process_pending_assemble_externals will be called at the end,
> > which calls assemble_external_real on all external symbols.
> > Do we still need TARGET_ASM_EXTERNAL_LIBCALL? Why can't
> > assemble_external_real handle it?
> 
> Look at, e.g., mcore_external_libcall in mcore.c, and at
> ASM_OUTPUT_EXTERNAL_LIBCALL in i386/cygming.h.  You need to handle
> cases like those somehow.  I agree that we could rework the way that
> TARGET_ASM_EXTERNAL_LIBCALL works today, but no matter what you still
> need some way to refer to an external libcall.

TARGET_ASM_EXTERNAL_LIBCALL is a subset of ASM_OUTPUT_EXTERNAL
which is called by assemble_external_real. Why do we need
TARGET_ASM_EXTERNAL_LIBCALL when there is ASM_OUTPUT_EXTERNAL?

---
@defmac ASM_OUTPUT_EXTERNAL (@var{stream}, @var{decl}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name of an external
symbol named @var{name} which is referenced in this compilation but
not defined.  The value of @var{decl} is the tree node for the
declaration.

This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don't require anything.
@end defmac

@deftypefn {Target Hook} void TARGET_ASM_EXTERNAL_LIBCALL (rtx @var{symref})
This target hook is a function to output to @var{asm_out_file} an assembler
pseudo-op to declare a library function name external.  The name of the
library function is given by @var{symref}, which is a @code{symbol_ref}.
@end deftypefn
----

In fact, ia64 uses ASM_OUTPUT_EXTERNAL and mips uses
TARGET_ASM_EXTERNAL_LIBCALL for generating:

.globl foo
.type foo,...

or

.globl foo .text

for calling external function, foo.


H.J.

Reply via email to