From e97274b542eca903b54ad99adf3407b829f4919b Mon Sep 17 00:00:00 2001
From: Andrej Shadura <andrew.shadura@collabora.co.uk>
Date: Sun, 1 Jan 2023 00:40:08 +0100
Subject: [PATCH] Update gimli to 0.27 and object to 0.30

Object 0.18 removed section_data_by_name.

Bug-Debian: https://bugs.debian.org/998306

Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
---
 Cargo.toml  | 4 ++--
 src/main.rs | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 4bab46a..ed74208 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,9 +9,9 @@ edition = "2018"
 anyhow = "1.0"
 serde = { version = "1", features = ["derive"] }
 serde_json = "1.0"
-gimli = "0.19"
+gimli = "0.27"
 fallible-iterator = "0.2"
 memmap = "0.7"
-object = { version = "0.12", features = [ "std", "compression" ] }
+object = { version = "0.30", features = [ "std", "compression" ] }
 typed-arena = "2"
 structopt = "0.3"
diff --git a/src/main.rs b/src/main.rs
index b370e4e..e89c157 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,7 +2,7 @@
 use anyhow::{anyhow, Error, Result};
 use fallible_iterator::{convert, FallibleIterator};
 use gimli::{AttributeValue, Endianity, Reader};
-use object::Object;
+use object::{Object, ObjectSection};
 use serde::ser::SerializeMap;
 use serde::{Serialize, Serializer};
 use std::borrow::{Borrow, Cow};
@@ -26,7 +26,8 @@ fn list_file<E: Endianity>(file: &object::File, endian: E) -> Result<Vec<Unit>>
         'a: 'file,
     {
         let data = file
-            .section_data_by_name(S::section_name())
+            .section_by_name(S::section_name())
+            .and_then(|section| section.uncompressed_data().ok())
             .unwrap_or(Cow::Borrowed(&[]));
         let data_ref = (*arena.alloc(data)).borrow();
         S::from(gimli::EndianSlice::new(data_ref, endian))
-- 
GitLab