length of external names

Walter Bright bright at dataio.UUCP
Thu Jan 10 03:29:39 AEST 1985


> The solution that was used, and worked, was to have the COMPILER use the
> external "name" to store a hashed value.  During the recent net
> discussion I posted a description of this technique and some analysis of
> the chance and cost of collisions.
> 
> This is done entirely in the compiler, and has no effect on the linker.
> 
>     To the net at large:
> 
> 1.  What are specific objections to the hashing technique?

a)	Reading linker maps would be terrible.
b)	All the other tools that depend on the global symbol table
	would be messed up. So, you say, rewrite the tools so they
	inverse hash the symbols. So then it would be easier to just
	fix the linker, and we're back where we started.

	My solution to the external symbol dilemma is that it should
	be implementation-defined, since the behavior is determined
	by the linker and the compiler writer typically has no
	control over the linker.

	If code is being ported to a machine with a smaller linker,
	the programmer could 'hash' the overly long externals himself
	with macros.



More information about the Comp.lang.c mailing list