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).

1•djrivard•26s ago

Cisco probably violated Middle Eastern and Muslim employees' civil rights

https://www.theguardian.com/technology/2026/aug/31/cisco-civil-rights-palestine-advocacy-violation
1•lorecore•26s ago•0 comments

AI swarms turn on their creators: "Made my stomach churn"

https://english.elpais.com/technology/2026-08-29/ai-swarms-turn-on-their-creators-its-the-first-i...
1•dxs•54s ago•0 comments

Urban Congestion Pricing and the Response Times of Emergency Medical Services

https://www.nber.org/digest/202609/urban-congestion-pricing-and-response-times-emergency-medical-...
1•ceejayoz•58s ago•0 comments

H3 Max Live: AI video generated faster than real time, directed by Twitch chat

https://twitter.com/rehan_shei/status/2093528415576211819
1•creatune•1m ago•0 comments

John Ternus Is Now Apple's CEO

https://www.apple.com/leadership/john-ternus/
1•mfiguiere•1m ago•0 comments

Mozilla Adds Built-In Ad Blocking to Firefox on iOS

https://linuxiac.com/mozilla-adds-built-in-ad-blocking-to-firefox-on-ios/
1•speckx•2m ago•0 comments

Show HN: Ambavi – Audible for things no one has recorded yet

https://ambavi.xyz/
1•nikasakana•2m ago•0 comments

Trump admin cuts political interference ban after unusual Census Bureau report

https://www.npr.org/2026/08/31/nx-s1-5948057/department-commerce-census-bureau-scientific-integrity
1•hn_acker•2m ago•1 comments

Genealogy IDs Woman Whose Rapist Died in Jail, Another John DOE from 1988

https://www.forensicmag.com/3594-All-News/627563-Genealogy-ID-s-Woman-Whose-Rapist-Died-in-Jail-A...
1•WaitWaitWha•2m ago•0 comments

John Ternus Is Now Apple's CEO

https://www.macrumors.com/2026/09/01/john-ternus-is-now-apple-ceo/
1•thm•2m ago•0 comments

Show HN: Binocular Discrepancy – experiments with dichtopic presentation (WebXR)

https://binocular-discrepancy.github.io/
1•r34•2m ago•0 comments

Curing cancer won't redeem AI

https://www.writingruxandrabio.com/p/curing-cancer-wont-redeem-ai
1•jger15•3m ago•0 comments

South Korea's 'AI for All' Push Gives Free Access to Every Citizen

https://www.wsj.com/tech/ai/south-koreas-ai-for-all-push-gives-free-access-to-every-citizen-451f6b2c
1•jimmydoe•4m ago•0 comments

How an MIT research project became a global programming language

https://news.mit.edu/2026/how-mit-research-project-became-global-programming-language-0831
1•Stratoscope•5m ago•0 comments

ModelGate – Find repetitive and expensive LLM calls in your back end

https://github.com/razdgann/modelgate-oss/
1•razdada•5m ago•0 comments

Show HN: Dashwise – A customizable all-in-one homelab dashboard

https://github.com/andreasmolnardev/dashwise/
1•andreasmolnarde•5m ago•0 comments

Sketchometry.org – Free geometry tool for sketching with your finger

https://start.sketchometry.org/
1•azatom•6m ago•0 comments

The Un-Slop Fiction Prize

https://www.hyperstitionai.com/unslop
1•marksully•7m ago•0 comments

PrusaSlicer 3.0 Preview

https://www.youtube.com/watch?v=qMupKmuXoZc
1•ChristianJacobs•7m ago•0 comments

Insider: Red Hat is capping devs' bot budgets

https://www.theregister.com/ai-and-ml/2026/09/01/insider-red-hat-is-capping-devs-bot-budgets/5292620
2•AdmiralAsshat•7m ago•0 comments

Scientists identify early signal of dangerous pregnancy complications

https://www.science.org/content/article/scientists-identify-early-signal-dangerous-pregnancy-comp...
1•Brajeshwar•7m ago•0 comments

The hard parts of AI-assisted science

https://allenai.org/blog/swedish-autodiscovery-recap
1•ilreb•8m ago•0 comments

Mirror life is theoretical. The danger is anything but.

https://www.washingtonpost.com/opinions/2026/08/31/mirror-life-is-theoretical-research-danger-is-...
1•bookofjoe•9m ago•1 comments

Agentic Determinism Index (open source): Find where deterministic AI agents run

https://github.com/lemma-ventures/agentic-determinism-index
1•sp1nstate•9m ago•0 comments

Saab Enters Collaborative Combat Aircraft Race with High-End Concept

https://aviationweek.com/defense/aircraft-propulsion/saab-enters-collaborative-combat-aircraft-ra...
3•rbanffy•9m ago•0 comments

Ask HN: Has X.com database been leaked?

2•tough•9m ago•0 comments

Authorization Terminology Is a Mess: Let's Fix It

https://idpro.org/authorization-terminology-is-a-mess-lets-fix-it/
1•andychiare•10m ago•0 comments

Now OpenAI says Apple didn't protect its trade secrets enough

https://appleinsider.com/articles/26/09/01/its-not-our-fault-if-you-cant-keep-trade-secrets-opena...
1•alwillis•13m ago•0 comments

To Die and Live in L.A

https://lareported.substack.com/p/to-die-and-live-in-la
1•speckx•15m ago•0 comments