From mboxrd@z Thu Jan 1 00:00:00 1970 From: imp@bsdimp.com (Warner Losh) Date: Mon, 20 Feb 2012 19:50:00 -0700 Subject: [TUHS] why the leading under score added to function names? In-Reply-To: <96DE558D-5FE2-4F6F-BC83-18EC727162FA@coraid.com> References: <201202202052.q1KKqagi002055@freefriends.org> <96DE558D-5FE2-4F6F-BC83-18EC727162FA@coraid.com> Message-ID: And this convention went away with ELF binaries. No more _foo for function foo. Also, the fortran compiler would emit entry_ to as to not conflict either. Made calling C from Fortran, and vice versa, a lot of fun... Warner On Feb 20, 2012, at 5:34 PM, Brantley Coile wrote: > correct. we could link to assembler code with _entry points and not worry about symbol collisions in the rest of the code. > > iPhone email > > On Feb 20, 2012, at 6:23 PM, "Dave Horsfall" wrote: > >> On Mon, 20 Feb 2012, arnold at skeeve.com wrote: >> >> [...] >> >>> I'm pretty sure this dates back to PDP-11 days. I'm wondering "why?". >>> Why did the C compiler prepend an underscore to function names? >> >> Sure was the PDP-11 :-) I vaguely recall that it was to make sure that >> user functions did not conflict with predefined assembler functions, as >> that would be a pain to diagnose (much like having swap overlap root). >> >> -- Dave >> _______________________________________________ >> TUHS mailing list >> TUHS at minnie.tuhs.org >> https://minnie.tuhs.org/mailman/listinfo/tuhs > _______________________________________________ > TUHS mailing list > TUHS at minnie.tuhs.org > https://minnie.tuhs.org/mailman/listinfo/tuhs > >