Skip to content

Commit 81955f8

Browse files
committedMar 14, 2016
Allow any build-id length between 4 and 20 bytes inclusive
Build-id support is being added to lld and by default it may produce a 64-bit build-id. Prior to this change lldb would reject such a build-id. However, it then falls back to a 4-byte crc32, which is a poorer quality identifier. Differential Revision: http://reviews.llvm.org/D18096 llvm-svn: 263432
1 parent cdce026 commit 81955f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1410,8 +1410,9 @@ ObjectFileELF::RefineModuleDetailsFromNote (lldb_private::DataExtractor &data, l
14101410
// Only bother processing this if we don't already have the uuid set.
14111411
if (!uuid.IsValid())
14121412
{
1413-
// 16 bytes is UUID|MD5, 20 bytes is SHA1
1414-
if ((note.n_descsz == 16 || note.n_descsz == 20))
1413+
// 16 bytes is UUID|MD5, 20 bytes is SHA1. Other linkers may produce a build-id of a different
1414+
// length. Accept it as long as it's at least 4 bytes as it will be better than our own crc32.
1415+
if (note.n_descsz >= 4 && note.n_descsz <= 20)
14151416
{
14161417
uint8_t uuidbuf[20];
14171418
if (data.GetU8 (&offset, &uuidbuf, note.n_descsz) == nullptr)

0 commit comments

Comments
 (0)