-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modify elf #426
Comments
The dwarfdump example contains a use of For If you're looking to write out a fully valid elf, then you'll need a |
Also, if you only need this to work for executables and dynamic libraries (and not .o files), then the debuginfo won't have relocations. In that case, you can use |
I only need it to work for execute from flash embedded devices without any relocations and also only modifying the debug information which is dwarf 3 / dwarf 4. API wise I need to load every section indipendently put into |
Why not use
In the write tree, but note that write support is still under development. You're right that it has less convenience methods currently, but PRs to add them are welcome. |
If I use load,the conversion to |
That's a bug then. Can you give me the info required to reproduce it? |
I created this repo https://github.com/drahnr/dwarfhammer Sidenote: I also tried with Thanks for having a look into it, I'll try to create an example elf that shows the error. |
@philipc added a sample via a downloadable url to the repo with the commit called tmp |
The download link has expired. |
Mea culpa, updated 51b946, I made the repo private and added you as contributor, link is in the same file as before. |
Ok got that. It's missing a let comp_dir = match from_header.directory(0) {
Some(comp_dir) => LineString::from(comp_dir, dwarf, line_strings, strings)?,
None => LineString::String(Vec::new()),
}; |
Works for me, though I am not sure what the dwarf3/4/5 has to say about requirement of |
It doesn't seem to say it is required. |
Missing DW_AT_comp_dir fix is in #430. |
Attempting to get a kickstart from the examples, I tried to write a tool that adjusts some debugging symbols (mostly compileunit paths), but the exact requirement on what to pass to
read::Dwarf::load
andwrite::Dwarf::write
is not clear (I consulted the manual and the source, but that did not help much either).Can somebody shed some light on how to approach modifying a loaded
DebugAbbrev
andDebugInfo
writing a fully valid elf out with the modified changes? I'd much appreciate that.The text was updated successfully, but these errors were encountered: