Skip to content

Commit 739cd04

Browse files
authored
Much better support for ELF files (#755)
* Rebuild hello_elf using rustc 1.85.1 (4eb161250 2025-03-15) * Update object and gimli * Use runtime loaded size as total for ELF files If you care about binary size you are probably going to strip all debuginfo and symbols anyway. Unlike wasm, for elf twiggy requires debuginfo so people can't strip the executable before running twiggy on it and as such using the file size as total is misleading. * Use symbols rather than debuginfo for finding functions on ELF This allows functioning without debuginfo. Some standard library crates are intentionally compiled without debuginfo and as such previously didn't show up in the report at all or without function name. Same for the main function. This also adds statics and anonymous allocations as a side effect by not filtering their symbols out. * Handle call edges for ELF files based on relocations This also nicely handles edges involving statics and anonymous allocations too. * Add warning when there are no relocations * Regenerate without debuginfo * Rustfmt * Update proc-macro2
1 parent c71232e commit 739cd04

20 files changed

+881
-1265
lines changed

Cargo.lock

+24-89
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

parser/Cargo.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ path = "./parser.rs"
1414

1515
[dependencies]
1616
anyhow = "1.0"
17-
fallible-iterator = { version = "0.2.0", optional = true }
18-
gimli = { version = "0.27.3", optional = true, default-features = false, features = ["std", "read"] }
19-
object = { version = "0.17.0", optional = true }
17+
object = { version = "0.36.7", optional = true }
2018
wasmparser = "0.80.0"
21-
typed-arena = { version = "2.0.2", optional = true }
2219
twiggy-ir = { version = "=0.7.0", path = "../ir" }
2320
twiggy-traits = { version = "=0.7.0", path = "../traits" }
2421

2522
[features]
2623
default = ["dwarf"]
27-
dwarf = ["fallible-iterator", "gimli", "object", "typed-arena", "twiggy-traits/dwarf"]
24+
dwarf = ["object", "twiggy-traits/dwarf"]

parser/object_parse/compilation_unit_parse/mod.rs

-74
This file was deleted.

parser/object_parse/die_parse/item_name.rs

-44
This file was deleted.

0 commit comments

Comments
 (0)