[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
Mon Mar 14 07:11:00 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL263432: Allow any build-id length between 4 and 20 bytes inclusive (authored by emaste).

Changed prior to commit:
  http://reviews.llvm.org/D18096?vs=50464&id=50587#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18096

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

Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1410,8 +1410,9 @@
                     // Only bother processing this if we don't already have the uuid set.
                     if (!uuid.IsValid())
                     {
-                        // 16 bytes is UUID|MD5, 20 bytes is SHA1
-                        if ((note.n_descsz == 16 || note.n_descsz == 20))
+                        // 16 bytes is UUID|MD5, 20 bytes is SHA1. Other linkers may produce a build-id of a different
+                        // length. Accept it as long as it's at least 4 bytes as it will be better than our own crc32.
+                        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.50587.patch
Type: text/x-patch
Size: 1060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160314/fa311b1b/attachment.bin>


More information about the lldb-commits mailing list