3 ms·
Why does it need to parse elf ?
by temac 3y ago
Why does it need to parse elf ?
- lifthrasiir 3y agoThe stack frame is a list of return addresses which have to be translated to a file name and line number. Such debug information is within a specific ELF section in the predefined format. In this simple case you may be able to hard-code the offset to the section (and guarantee that it was never compressed), but any additional C or Rust library will break this assumption, so a general parser has to be included.
- nsteel 3y agoSorry if this is dumb but if the idea is stripping debug stuff, why would a parser for translating return addresses into file names and line numbers be useful? EDIT: oh, ok, so I guess it's because strip is "debuginfo" here, rather than "true".
- kobzol 3y agoThere is some work underway to enable removing the backtrace generation/parsing from Rust binaries. It's hardcoded for now though.