summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2016-03-14 14:06:00 +0000
committerEd Maste <emaste@freebsd.org>2016-03-14 14:06:00 +0000
commit81955f8048b36272f7e25ee7a8ae9f91590da42b (patch)
treebe5f54aad9466bc8d2122bf3e343d57989c93070 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
parentcdce026b4d44deee16f982f5db6afdb8215d77c1 (diff)
downloadbcm5719-llvm-81955f8048b36272f7e25ee7a8ae9f91590da42b.tar.gz
bcm5719-llvm-81955f8048b36272f7e25ee7a8ae9f91590da42b.zip
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
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index acde882b63f..e20f994576e 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1410,8 +1410,9 @@ ObjectFileELF::RefineModuleDetailsFromNote (lldb_private::DataExtractor &data, l
// 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)
OpenPOWER on IntegriCloud