-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Allow preserving name
section without other debug info
#14623
Comments
+cc @walkingeyerobot |
How about just having a new option like |
I don't have strong feelings. My preference was for the section to be treated like the symbol table. Keep if But a separate flag is fine, too, considering that my workaround is to use objcopy to drop just the |
I think this should work today with |
So @dschuff also has out https://reviews.llvm.org/D73820 which seems relevant. In a case where I'm already setting |
Is it the case that using |
I think what I'm trying to say is that |
Yeah, that is probably a holdover from before DWARF even existed. It probably makes sense to treat the name section like ELF symbol tables, and have |
Looking again at https://reviews.llvm.org/D73820 reminded me that wasm of course also does have a symbol table that plays the same role in linking as ELF's. The difference is that in ELF that linking symbol table is also used for symbolization, and in wasm it's the name section instead. So I think you could make the case for either behavior: 1) the Would changing the behavior of |
I'm not sure I understand the question. AFAICT it would be a behavior change, and could be noticed by folks. (i.e. now their binaries are bigger). At least Ultimately, I agree--I can see arguments for either (1) or (2). |
I'm fine with (2) and I agree we should probably keep the meaning of I can't imagine there will be many user of Also, the name section is now also used during |
Sounds good to me, let's go with 2). |
OK, so it turns out that as of llvm/llvm-project@7cb25f5 |
/cc @sunfishcode in case you have opinions, since this seems nice for non-emscripten use too. |
Leave the name section in the output when using the --strip-debug flag. This treats it more like ELF symbol tables, as the name section has similar uses at runtime (e.g. wasm engines understand it and it can be used for symbolization at runtime). Fixes emscripten-core/emscripten#14623 Differential Revision: https://reviews.llvm.org/D106728
Leave the name section in the output when using the --strip-debug flag. This treats it more like ELF symbol tables, as the name section has similar uses at runtime (e.g. wasm engines understand it and it can be used for symbolization at runtime). Fixes emscripten-core/emscripten#14623 Differential Revision: https://reviews.llvm.org/D106728
Usecase:
The
name
section is similar to the symbol table for ELF binaries. It can be used to symbolize functions at runtime (or after the fact as well).This is exposed generally via
emscripten_pc_get_function
library call (and used by the sanitizer stacktraces).It uses the
wasmOffsetConverter
which in turn uses the WebAssemblyname
section.It is useful to be able to do symbolization without all the other debug info, and for ELF binaries, this is typically possible as long as the binary is not entirely stripped. This is typically the difference between
--strip-debug
and--strip-all
options.Unfortunately, binaryen and
wasm-ld
both treat thename
section as debug info, and so it is stripped with the rest of the debug information.I propose that the
name
section be treated like the symbol table in ELF, and preserved when only discarding debug info, but can be dropped if--strip-all/--strip-unneeded
is passed.The text was updated successfully, but these errors were encountered: