This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Builtins-vs-libcalls-vs-optimised-away-vs-still-emitting-an-undefined-symbol-reference
On 24 April 2007 16:00, Dave Korn wrote:
> I'd say that I've inherited a thinko-fied version of ASM_OUTPUT_EXTERNAL
Wrong, wrong, wrong. I don't have an ASM_OUTPUT_EXTERNAL at all. What I do
have, however, is TARGET_ASM_GLOBALIZE_LABEL, which appears to somehow be
equated with ASM_OUTPUT_EXTERNAL_LIBCALL.
(gdb) bt
#0 rtmi_globalize_label (stream=0x611010e8, name=0xd3a988 "ffs") at
/tools/external_source/gnu/gcc-3.3.3/gcc/config/rtmi/rtmi.c:158
#1 0x0047c05d in assemble_external_libcall (fun=0x7feb1b80) at
/tools/external_source/gnu/gcc-3.3.3/gcc/varasm.c:1742
#2 0x004f37aa in emit_library_call_value_1 (retval=1, orgfun=0x7feb1b80,
value=0x0, fn_type=LCT_CONST, outmode=SImode, nargs=1, p=0x23c37c "") at
/tools/external_source/gnu/gcc-3.3.3/gcc/calls.c:3820
...where it says:
3818 /* If this machine requires an external definition for
library
3819 functions, write one out. */
- 3820 assemble_external_libcall (fun);
Ah, it's elfos.h that does it:
/* The standard SVR4 assembler seems to require that certain builtin
library routines (e.g. .udiv) be explicitly declared as .globl
in each assembly file where they are referenced. */
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
(*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
That comment doesn't apply to me, so I can undef and redefine it in my tm.h
to point to something that emits an .extern instead of a .global. As I see a
lot of other ports do. Thanks for the help.
cheers,
DaveK
--
Can't think of a witty .sigline today....