frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•1y ago
I'd like to do some statistics over the machine code gcc generates, such as a histogram of used instructions, average volatile/preserved registers usage of functions etc. For now just x86_64 SysV-ABI would be enough.

However I'm not aware of any pre-existing tool that lets me easily do this. The options I currently see are either make gcc output assembly and write a parser for the GNU Assembler format (possibly by reusing the asm-parser of the compiler-explorer project), or write a tool that reads (disassembles) object files directly using elfutils.

Any hints, prior work, further ideas, links to useful resources, or any other kind of help would be much appreciated.

Comments

baobun•1y ago
"Static analysis" should be a relevant search term. Assuming you don't need to tie the instructions back to C code then the "gcc" part seems circumstancial for implementation? I guess you might want to parse the ASM into an Abstract Syntax Tree (AST) represenation and work on that?

If you do want to tie it back to the source, this looks relevant: http://icps.u-strasbg.fr/~pop/gcc-ast.html

phafu•1y ago
For my purpose I don't need to get back to the original source, no.

The gcc part is only relevant with regards to what dialect of assembler I need to parse. If I go that route, I'd write a parser for the GNU assembler, and that would of course work with any code in that dialect, regardless from which compiler it came from (I haven't checked whether other compilers can produce GNU assembler though).

Data Engineers Should Be Held to the Same Standards as Bakers

https://www.hermit-tech.com/blog/data-engineers-and-bakers
1•l0b0•50s ago•0 comments

Bob's Research, stock analysis, all filings read for you

https://www.bobsresearch.com/
1•mrmarco•2m ago•0 comments

TwoMillionKit: Private Cloud Compute in FoundationModels without an entitlement

https://github.com/insidegui/TwoMillionKit
1•zdw•9m ago•0 comments

'Quality decays exponentially following AI arrival': Experts leaving in droves

https://www.techradar.com/pro/quality-decays-exponentially-following-ai-arrival-research-shows-ex...
1•Fricken•11m ago•0 comments

Red Hat's Project Lightwell. Interview with Mo Duffy

https://opensourcesecurity.io/2026/2026-07-lightwell-mo-duffy/
1•LaSombra•15m ago•0 comments

NyxOS

https://github.com/kazah-png/nyx-os
1•kazah•21m ago•0 comments

Ask HN: How long do you use your personal laptop before replacing it?

3•thallavajhula•25m ago•1 comments

Gleam for Python Programmers

https://third-bit.com/gl4py/
2•TheWiggles•27m ago•0 comments

Letl1en

1•l1en•28m ago•0 comments

Billionaire exodus? California drew 10x more venture capital than anyother state

https://www.latimes.com/business/story/2026-07-10/billionaire-exodus-california-attracted-10-time...
1•WarOnPrivacy•28m ago•1 comments

Is the top song on Australian radio AI-generated?

https://www.theguardian.com/music/2026/jul/13/josh-fawaz-like-a-prayer-song-is-it-ai-radio
2•sbulaev•29m ago•0 comments

Sticky Note Chrome Extension Turns Favorites into Multimedia Sticky Notes

https://chromewebstore.google.com/detail/sticky-note-web-clipper-s/gniilbpapgommpalikcclpcnbcamgila
1•taskloco_nyc•31m ago•0 comments

The Future Worth Building Is Human

https://thinkingmachines.ai/blog/the-future-worth-building-is-human/
1•gmays•32m ago•0 comments

The University in the AI Era

https://htmx.org/essays/universities-and-ai/
1•vismit2000•33m ago•0 comments

Comparing the Burn Ability of 4 Materials Used for Wall Insulation [video]

https://www.youtube.com/watch?v=CdItsso3ur0
1•nomilk•34m ago•0 comments

[jdubray/sam-lib] V2 (PR #25)

https://github.com/jdubray/sam-lib/pull/25
1•turtleyacht•34m ago•1 comments

Show HN: 2026 World Cup Simulator with redemition mode

https://7-0worldcup.org/
1•cksmct•35m ago•0 comments

Droidsaw Rust Utility

https://lib.rs/crates/droidsaw
1•axus•36m ago•0 comments

Ask HN: As a customer, how do you feel about AI-First Customer Support?

2•gerardojbaez•45m ago•1 comments

Fable 5 on Playcode. As well as Sol, Grok 4.5 and GLM 5.2

https://playcode.io/blog/fable-5
1•ianberdin•52m ago•0 comments

Playcode Cloud – Firecracker backed and Neon inspired

https://playcode.io/blog/playcode-cloud
1•ianberdin•53m ago•0 comments

Adapnex: PLC Programming for Software Engineers

https://adapnex.com/
1•nobodyknowsyoda•58m ago•0 comments

A Metallurgist's Doubts About Self-Replicating Probes

https://www.centauri-dreams.org/2026/07/10/a-metallurgists-doubts-about-self-replicating-probes/
5•EA-3167•59m ago•0 comments

Global Talent Fund

https://www.globtalent.org/
1•nobodyknowsyoda•1h ago•0 comments

Common Cog: The Calibration Case Method

https://commoncog.com/calibration-case-method/
2•nobodyknowsyoda•1h ago•0 comments

This summer ski destination in the Andes isn't getting enough snow

https://www.cnn.com/2026/07/11/americas/chile-santiago-ski-snow-intl-latam
1•mooreds•1h ago•0 comments

Count Binface

https://countbinface.com
69•mooreds•1h ago•15 comments

Tend turns intent into local, reviewable feeds you can inspect, steer, and teach

https://github.com/EveryInc/tend
1•mooreds•1h ago•0 comments

Run SSH and Claude Code on 3DS

1•cadl11•1h ago•0 comments

Global Careers Hub – Free AI Tools, Scholarships and Career Resources

https://globalcareers-3qwcpfkw.manus.space/
1•Shuborna•1h ago•0 comments