Skip to content

Commit 40178f6

Browse files
committed
Changes for gimli-rs/object#133
1 parent 8536514 commit 40178f6

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ features = ["compression", "read", "std"] # We don't need WASM support
4545
#[patch.crates-io]
4646
#gimli = { path = "../" }
4747

48+
[patch.crates-io]
49+
# FIXME switch back to crates.io once gimli-rs/object#133 is published
50+
object = { git = "https://github.com/gimli-rs/object.git" }
51+
4852
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
4953
cranelift-simplejit = { git = "https://github.com/CraneStation/cranelift.git" }
5054

src/backend.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,7 @@ impl WriteDebugInfo for ObjectProduct {
149149
}
150150
DebugRelocName::Symbol(id) => {
151151
let symbol_id = self.function_symbol(*symbol_map.get_index(id).unwrap().0);
152-
let symbol = self.object.symbol(symbol_id);
153-
154-
// A symbol gets a section assigned when `add_symbol_data` is called.
155-
let section = symbol.section.expect("Symbol not defined");
156-
let symbol_offset = symbol.value;
157-
158-
(self.object.section_symbol(section), symbol_offset)
152+
self.object.symbol_section_and_offset(symbol_id).expect("Debug reloc for undef sym???")
159153
}
160154
};
161155
self.object.add_relocation(from.0, Relocation {

0 commit comments

Comments
 (0)