Subject: Re: Leading Underscores on Symbols
To: Gary Duzan <gary@wheel.tiac.net>
From: Simon Burge <simonb@telstra.com.au>
List: tech-toolchain
Date: 04/07/1999 22:49:11
Gary Duzan wrote:

> 
>    I recently submitted a bug report to the Mozilla folks to add
> a leading underscore when looking up symbols with dlsym(), which
> seemed to be correct for my i386 box, but now I'm wondering if it
> is the same for all platforms. Is is, for example, an ELF vs. a.out
> thing, or do all platforms include the underscore? Thanks.

On a pmax (ELF):

	mona:pc532/floppies/inst 54# cc -v -E - < /dev/null
	Using builtin specs.
	gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
	 /usr/libexec/cpp -lang-c ... -D__NO_LEADING_UNDERSCORES__ ...
	mona:pc532/floppies/inst 55# nm /usr/src/bin/cat/obj.pmax/cat | grep -w main
	0040079c T main

I don't know if __NO_LEADING_UNDERSCORES__ applies to other ELF ports
though...

Simon.