diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index d9a4408ee4..a71e5f1280 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -621,7 +621,19 @@ cmELF::StringEntry const* cmELFInternalImpl::GetDynamicSectionString( // Make sure the whole value was read. if (!(*this->Stream)) { - this->SetErrorMessage("Dynamic section specifies unreadable RPATH."); + if (tag == cmELF::TagRPath) { + this->SetErrorMessage( + "Dynamic section specifies unreadable DT_RPATH"); + } else if (tag == cmELF::TagRunPath) { + this->SetErrorMessage( + "Dynamic section specifies unreadable DT_RUNPATH"); + } else if (tag == cmELF::TagMipsRldMapRel) { + this->SetErrorMessage( + "Dynamic section specifies unreadable DT_MIPS_RLD_MAP_REL"); + } else { + this->SetErrorMessage("Dynamic section specifies unreadable value" + " for unexpected attribute"); + } se.Value = ""; return nullptr; }