From owner-freebsd-hackers Sat Oct 10 09:41:24 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA26614 for freebsd-hackers-outgoing; Sat, 10 Oct 1998 09:41:24 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA26576 for ; Sat, 10 Oct 1998 09:41:11 -0700 (PDT) (envelope-from jdp@austin.polstra.com) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.8.8/8.8.8) with ESMTP id JAA15044; Sat, 10 Oct 1998 09:40:53 -0700 (PDT) (envelope-from jdp) Message-Id: <199810101640.JAA15044@austin.polstra.com> To: David Holland cc: hackers@FreeBSD.ORG Subject: Re: mail in free(): warning: junk pointer, too high to make sense. In-reply-to: Your message of "Sat, 10 Oct 1998 03:21:33 EDT." <98Oct10.032139edt.37814-22953@qew.cs.toronto.edu> Date: Sat, 10 Oct 1998 09:40:53 -0700 From: John Polstra Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > The rationale is no mystery. It comes directly from the ELF > > specification, aka "System V Application Binary Interface," > > Prentice-Hall, 1990, ISBN 0-13-877598-2, page 4-25: > > > > External C symbols have the same names in C, assembly code, and > > object files' symbol tables. > > That's not a rationale, just a standard :-) :-) > (what *was* the rationale, anyway?) I wasn't privy to their thinking process, but one advantage is that it makes dlsym() a lot less confusing. You don't have to decide whether to pass in the assembly language name or the C name, because they're the same. But a better question might be: what was the rationale for adding those leading underscores in the first place? The answer is that the PDP-11 assembler used names like "r0" for its registers. Without the leading underscore, a C variable "r0" would have collided with the register name. In order to get rid of the underscores for SVR4, they had to give the registers names that were illegal in C (like "%eax"). John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message