Conversation
Also support global names in the name section
|
|
||
| # Data section | ||
| # FIXME: This is wrong, should be the data section header | ||
| # CHECK!!!!: 1c6-1c9 3 [Wasm Section Headers] |
There was a problem hiding this comment.
Something very strange is going on here. When I run bloaty with -vv I can see in the log:
[shortsymbols, wasm_function] AddFileRange(main, 1b6, 10)
[shortsymbols, wasm_overhead] AddFileRange([Wasm Section Headers], 1c6, 3)
(and no unexpected AddFileRange calls for "main").
But the file map output has
1b6-1c6 16 main
1c6-1c9 3 main
i.e. the name from the entry starting at 1b6 entry has overridden the 1c6 entry. "main" is the last entry in the code section, and the section header entry is the first one in the data section. A similar overflow seems to happen between the data and name sections below.
Any idea what might be happening?
There was a problem hiding this comment.
Oh, I think you might be running into a heuristic that has gone wrong:
https://github.com/google/bloaty/blob/master/src/range_map.cc#L294-L300
https://github.com/google/bloaty/blob/master/src/range_map.h#L170-L173
This is intended to fill in padding gaps between functions. But it's gone wrong here, because your [Wasm Section Headers] is an accurate/precious label, not a fallback.
We should probably change that combining Compress() pass to run prior to AddCatchAll(), and look for truly empty ranges rather than fallback ranges.
|
(oops this should still be a draft PR but I can't seem to convert it) |
Also support global names in the name section