Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Oct 1998 04:41:10 -0600
From:      Warner Losh <imp@village.org>
To:        David Holland <dholland@cs.toronto.edu>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: mail in free(): warning: junk pointer, too high to make sense. 
Message-ID:  <199810101041.EAA10555@harmony.village.org>
In-Reply-To: Your message of "Sat, 10 Oct 1998 03:21:33 EDT." <98Oct10.032139edt.37814-22953@qew.cs.toronto.edu> 
References:  <98Oct10.032139edt.37814-22953@qew.cs.toronto.edu>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <98Oct10.032139edt.37814-22953@qew.cs.toronto.edu> David Holland writes:
: That's not a rationale, just a standard :-)
: 
: (what *was* the rationale, anyway?)

In the old world order (a.out), the compiler prepended a _ to all the
symbols that the user generated to keep them from conflicting with
ones that the compiler generated (which didn't have the leading _).
However, this introduced a lot of hair into all those things that look
at symbols that want to render them as the user entered them, rather
than as the system sotred them: debuggers, etc.  Also, there were
still a fair number of assembler programmers writing assembler when
the decision was made to go with this convention in the a.out world,
and I suspect that they had arguments about being able to hide their
functions from 'C' by a similar method.  I also think that the
assembler or loader tossed all local branch targets based on their
name, which made that code really easy to write.  If it starts with a
L, junk it.  With semantics like that, you would be effectively
preventing user's from having any variables or functions starting with
L...

So when it came time to do ELF, times had changed.  There were fewer
assembly langauage programmers in the world and the compiler could
more easily arrange to generate temporaries, and the assembler could
more easily mark the symbols as local.  And hardware had gotten
faster, so it was better to make life easier for most people at the
expense of the compiler/assembler/linker programs.  They could now be
more complex and the rather simple minded (but space efficient) way of
junking local symbols could change.

Warner

P.S.  This is more speculative than "I was there and talked to these
guys," so if you were there and talked to the implementors of ELF (or
if you were an implementor of ELF) please feel free to correct me.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810101041.EAA10555>