summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2021-06-17 12:18:13 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-24 14:57:51 (GMT)
commit0da1540aaa8d36145329572938aeec6c86fb1ee7 (patch)
treef3831b276a19a1c870af6420065f155df0d8cc22 /Source/cmSystemTools.cxx
parente21188df8bd08a5f306afc09bcb829d148b982d5 (diff)
downloadCMake-0da1540aaa8d36145329572938aeec6c86fb1ee7.zip
CMake-0da1540aaa8d36145329572938aeec6c86fb1ee7.tar.gz
CMake-0da1540aaa8d36145329572938aeec6c86fb1ee7.tar.bz2
cmELF: Fix check for TagMipsRldMapRel
DT_MIPS_RLD_MAP_REL is a machine-speicific dynamic tag, so other architectures could re-use the value of 0x70000035 to mean something else. Before using DT_MIPS_RLD_MAP_REL, we have to check that the ELF file is actually has a e_machine of EM_MIPS.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 488e69c..d6b8208 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -3102,8 +3102,7 @@ static cm::optional<bool> RemoveRPathELF(std::string const& file,
entriesErased++;
continue;
}
- if (cmELF::TagMipsRldMapRel != 0 &&
- it->first == cmELF::TagMipsRldMapRel) {
+ if (it->first == cmELF::TagMipsRldMapRel && elf.IsMIPS()) {
// Background: debuggers need to know the "linker map" which contains
// the addresses each dynamic object is loaded at. Most arches use
// the DT_DEBUG tag which the dynamic linker writes to (directly) and