News for hackers. Stuff that matters.
Re:Making Rust binaries smaller by default by temac on Wednesday January 24, 2024 @03:15AM (#39114901)
Why does it need to parse elf ?
Re:Making Rust binaries smaller by default by lifthrasiir on Wednesday January 24, 2024 @03:23AM (#39114956)
The 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.
Re:Making Rust binaries smaller by default by nsteel on Wednesday January 24, 2024 @07:41AM (#39116565)
Sorry 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".

Re:Making Rust binaries smaller by default by kobzol on Wednesday January 24, 2024 @08:41AM (#39117208)
There is some work underway to enable removing the backtrace generation/parsing from Rust binaries. It's hardcoded for now though.