Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This amends my old PR, #24. Here is the background.
When you build an iOS app for distribution, it generates debug symbols in a separate bundle ("the dSYM bundle"). The bundle contains a MachO binary that lists all the normal program sections -
__text
,__data
- but doesn't contain them physically. Parsing those dSYM binaries withfilebytes
is a part of my use case. I was assuming, for a while, that the only real sections in those are the__debug_xxx
ones (i. e. DWARF).Now, in a recent Xcode build, I'm looking at a dSYM bundle where there are some real sections outside of DWARF - specifically,
__eh_frame
and__unwind__info
, in the__TEXT
segment. Looking at those is relevant to my use case, also.Taking a closer look at the MachO headers of a dSYM bundle, I've noticed that all dummied out sections have their
offset
field set to zero. I tried finding a reference to this behavior in ABI documents, but could not. Other section header fields look as if the section was real. So rather than trying to check for all section names that might be present in a dSYM in__parseSections
, I've changed the check to just that - nonzero offset means the section is present.This might lead to higher memory consumption when loading dSYM bundles (e. g. there are some nondummy vendor sections in the __DWARF segment). But at least no sections will be left behind (unless another ABI quirk surfaces).