Collision-resistant hashing

Mark Mitchell mark at codesourcery.com
Wed Dec 1 06:11:29 UTC 1999


>>>>> "Jim" == Jim Dehnert <dehnert at baalbek.engr.sgi.com> writes:

    Jim> I'm intrigued by Jonathon's idea of separating the link name
    Jim> from the "real" mangled name.  Suppose we used the

I thought that was my idea. :-) :-) Maybe I didn't state it this
particular option.

    Jim> collision-resistant hash to generate the names in the linker
    Jim> symbol table from the agreed-upon mangled names, and included
    Jim> the mangled names in a separate table to provide de-mangling
    Jim> capability.  This table could include the hashed name
    Jim> mapping, or we could just apply the hash function to the list
    Jim> if needed.

    Jim> Note that this wouldn't save object file space relative to
    Jim> just using a compact mangling scheme, since we still include
    Jim> the names, but it would mean that the linker could see only
    Jim> short names.  I could imagine a linking speed benefit.  Any
    Jim> opinions?

There's still a space benefit as well: you can drop the demangling
table when not compiling with -g, or with `strip', say.  For example,
you could ship a shared library without the demangling table, but
still allow people to link to it.

Also, you can still save a lot of space in assembly output.  Debuggers
probably run a little more quickly too.

This is essentially what I intended my original proposal to be, so I'm
in favor.

--
Mark Mitchell                   mark at codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com




More information about the cxx-abi-dev mailing list