From 4530050873d77a0bb9ffe182de994b2af14099b0 Mon Sep 17 00:00:00 2001 From: Joe Rozner Date: Thu, 19 Nov 2026 19:20:52 +0000 Subject: [PATCH] [DWARF Import] Update object to 0.41 to read Xtensa debug relocations Loading an Xtensa relocatable object built with -g failed with "Failed to load DWARF info: Unsupported relocation type", so no debug info was imported. ESP-IDF builds with -ggdb by default, so this affected nearly every object built for the ESP32, ESP32-S2, ESP32-S3 and ESP8266. object 0.41 handles these relocations itself (gimli-rs/object#1010): it skips the R_XTENSA_DIFF*/PDIFF*/NDIFF* label-difference relocations, whose result GNU as has already stored, and gives R_XTENSA_32 an implicit addend, since binutils treats it as partial-inplace even though Xtensa uses RELA. Without that, a DW_FORM_strp emitted as R_XTENSA_32 .debug_str + 0 would read as offset 0. --- Cargo.lock | 27 ++++++++++++++++++--------- plugins/dwarf/dwarf_import/Cargo.toml | 2 +- plugins/dwarf/shared/Cargo.toml | 2 +- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 885e1da294..01a336ff3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -843,7 +843,7 @@ dependencies = [ "gimli", "indexmap", "iset", - "object 0.36.7", + "object 0.41.0", "regex", "tracing", ] @@ -865,7 +865,7 @@ dependencies = [ "binaryninja", "binaryninjacore-sys", "gimli", - "object 0.36.7", + "object 0.41.0", "thiserror 2.0.18", "zstd", ] @@ -1845,9 +1845,7 @@ version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ - "flate2", "memchr", - "ruzstd 0.7.3", ] [[package]] @@ -1861,6 +1859,17 @@ dependencies = [ "ruzstd 0.8.2", ] +[[package]] +name = "object" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11dbdb66876026054e4ffc8d757d862bdf5df5aebd5c0b95a41f17832a94f7d2" +dependencies = [ + "flate2", + "memchr", + "ruzstd 0.9.1", +] + [[package]] name = "once_cell" version = "1.21.3" @@ -2423,18 +2432,18 @@ dependencies = [ [[package]] name = "ruzstd" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad02996bfc73da3e301efe90b1837be9ed8f4a462b6ed410aa35d00381de89f" +checksum = "e5ff0cc5e135c8870a775d3320910cd9b564ec036b4dc0b8741629020be63f01" dependencies = [ - "twox-hash 1.6.3", + "twox-hash 2.1.2", ] [[package]] name = "ruzstd" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ff0cc5e135c8870a775d3320910cd9b564ec036b4dc0b8741629020be63f01" +checksum = "69e4ce4a039f42bf25920b95667e4d789e98749ab11bbb8d2c2936f788421bb5" dependencies = [ "twox-hash 2.1.2", ] diff --git a/plugins/dwarf/dwarf_import/Cargo.toml b/plugins/dwarf/dwarf_import/Cargo.toml index bbd898b35d..b45636b4e1 100644 --- a/plugins/dwarf/dwarf_import/Cargo.toml +++ b/plugins/dwarf/dwarf_import/Cargo.toml @@ -20,5 +20,5 @@ iset = "0.2.2" cpp_demangle = "0.5.1" regex = "1" indexmap = "2.5.0" -object = "0.36" +object = "0.41" tracing = "0.1" diff --git a/plugins/dwarf/shared/Cargo.toml b/plugins/dwarf/shared/Cargo.toml index e1404c74dd..415e0bdaae 100644 --- a/plugins/dwarf/shared/Cargo.toml +++ b/plugins/dwarf/shared/Cargo.toml @@ -12,4 +12,4 @@ binaryninjacore-sys.workspace = true gimli = "0.31" zstd = "0.13.2" thiserror = "2.0" -object = "0.36" +object = "0.41"