[PATCH] D18055: ELF: Implement --build-id.

Ismail Donmez via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 00:59:26 PST 2016


Hi,

On Thu, Mar 10, 2016 at 9:23 PM, Rui Ueyama via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> ruiu created this revision.
> ruiu added reviewers: rafael, emaste.
> ruiu added a subscriber: llvm-commits.
>
> This is not ready for submission.
>
> This patch implements --build-id in a naive way. After the linker creates
> an output file in the memory buffer, it computes the md5sum of the resulting
> file and set the hash to the .note section as a build-id.
>
> The problem is that its performance impact is too large. Computing a secure
> hash is a computational intensive task (our md5sum function seems a bit too
> slow, though). Here are some numbers (milliseconds to link):
>
> LLD:     713.78 ->  883.44 (+23.8%)
> Scylla: 5005.64 -> 5437.84 (+8.6%)
>
> Even if we replace MD5 with a faster hash function, it cannot be within
> an "okay" range, which is, say, +3%.
>
> Do you guys have any opnion on this? I have a few ideas.
>
>  - Use CRC32 instead of MD5. Non-secure hash should be much faster.

Since you have to be compatible with other linkers here I don't see a
way to change the hashing algorithm.

Also, there seem to be some optimized MD5 implementations such as
http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
which would be worth to look at.

Regards,
İsmail


More information about the llvm-commits mailing list