Blob Blame History Raw
From 203fe1e00d5d751763e0aaec75f4abe670271b81 Mon Sep 17 00:00:00 2001
From: bjorn3 <bjorn3@users.noreply.github.com>
Date: Thu, 30 Apr 2020 12:16:46 +0200
Subject: [PATCH] Update object

---
 src/lib.rs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib.rs b/src/lib.rs
index c72dffbd036b..0173a26418bc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -99,9 +99,12 @@ impl Context<gimli::EndianRcSlice<gimli::RunTimeEndian>> {
             S: gimli::Section<gimli::EndianRcSlice<Endian>>,
             Endian: gimli::Endianity,
         {
+            use object::ObjectSection;
+
             let data = file
-                .section_data_by_name(S::section_name())
-                .unwrap_or(Cow::Borrowed(&[]));
+                .section_by_name(S::section_name())
+                .and_then(|section| section.data().ok())
+                .unwrap_or(&[]);
             S::from(gimli::EndianRcSlice::new(Rc::from(&*data), endian))
         }
 
-- 
2.26.2