Skip to content

Add -d archs data source for Mach-O universal binaries#481

Merged
haberman merged 1 commit into
google:mainfrom
rjmansfield:macho-archs-support
May 31, 2026
Merged

Add -d archs data source for Mach-O universal binaries#481
haberman merged 1 commit into
google:mainfrom
rjmansfield:macho-archs-support

Conversation

@rjmansfield

Copy link
Copy Markdown
Contributor

Implements the 'archs' data source to break down universal binaries by architecture.

This allows users to:

  • View file size breakdown by architecture: bloaty -d archs
  • Filter to specific architecture: bloaty -d archs,segments --source-filter=arm64
  • Hierarchical breakdown: bloaty -d archs,segments

This was proposed in #153 (comment) to show the breakdown per architecture using the --source-filter= option.

Note: this has the current limitation which shows incorrect VM sizes because both architectures have overlapping VM addresses, so the workaround would be --source-filter=, or to only use --domain=file. The overlapping VM addresses requires separate address spaces are used. e.g. #480

Implements the 'archs' data source to break down universal binaries
by architecture.

This allows users to:

- View file size breakdown by architecture: bloaty -d archs
- Filter to specific architecture: bloaty -d archs,segments --source-filter=arm64
- Hierarchical breakdown: bloaty -d archs,segments
@rjmansfield

Copy link
Copy Markdown
Contributor Author

Previous patch failed on non-darwin platforms because I missed including "third_party/darwin_xnu_macho/mach/machine.h" for them. Should be fixed now.

@rjmansfield

Copy link
Copy Markdown
Contributor Author

Can the CI be kicked for the updated patch?

@rjmansfield

Copy link
Copy Markdown
Contributor Author

Looks like the CI jobs all passed so can this be merged?

@haberman haberman merged commit 4a601b6 into google:main May 31, 2026
10 checks passed
@rjmansfield rjmansfield deleted the macho-archs-support branch May 31, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants