From e21188df8bd08a5f306afc09bcb829d148b982d5 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Thu, 24 Jun 2021 10:55:58 -0400
Subject: [PATCH] cmELF: Open file explicitly in binary mode

ELF is a binary format.
---
 Source/cmELF.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index deffdb6467c..01dc0b1d6ee 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -683,7 +683,7 @@ const long cmELF::TagMipsRldMapRel = 0;
 cmELF::cmELF(const char* fname)
 {
   // Try to open the file.
-  auto fin = cm::make_unique<cmsys::ifstream>(fname);
+  auto fin = cm::make_unique<cmsys::ifstream>(fname, std::ios::binary);
 
   // Quit now if the file could not be opened.
   if (!fin || !*fin) {
-- 
GitLab