[Lldb-commits] [PATCH] D18096: accept any build-id length between 4 and 20 bytes inclusive

Ed Maste via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 11 12:22:33 PST 2016


emaste created this revision.
emaste added a reviewer: lldb-commits.

There's a proposed patch D18091 adding build-id support to lld that would produce a 64-bit ID. There's some concern as existing tools typically expect the build-id to be either 16 or 20 bytes.

Prior to this change lldb would reject such a build-id, but that doesn't make sense given that lldb will fall back to a 4-byte crc32, a poorer quality identifier. Now we accept the build-id if it is 4 bytes or more.

http://reviews.llvm.org/D18096

Files:
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1411,7 +1411,7 @@
                     if (!uuid.IsValid())
                     {
                         // 16 bytes is UUID|MD5, 20 bytes is SHA1
-                        if ((note.n_descsz == 16 || note.n_descsz == 20))
+                        if (note.n_descsz >= 4 && note.n_descsz <= 20)
                         {
                             uint8_t uuidbuf[20];
                             if (data.GetU8 (&offset, &uuidbuf, note.n_descsz) == nullptr)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18096.50464.patch
Type: text/x-patch
Size: 696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160311/af86828d/attachment.bin>


More information about the lldb-commits mailing list