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

A Chinese Coal City Finds New Use for Old Mines: Cooling Homes

https://www.sixthtone.com/news/1018850
1•speckx•42s ago•0 comments

The Danube River's water is dropping so low that World War II ships are emerging

https://www.pbs.org/newshour/world/the-danube-rivers-water-is-dropping-so-low-that-world-war-ii-s...
1•bookofjoe•1m ago•0 comments

US and China race to be first to build Skynet. Either way we're F'ed

1•spottedmarley•2m ago•0 comments

Show HN: I built a pg-migration-engine on NPM

1•Vivek-KY•2m ago•0 comments

Grand Theft Auto VI: An Extended Look Coming August 27 [video]

https://www.youtube.com/watch?v=qq76pQsI1iw
1•HelloUsername•3m ago•0 comments

Ddsdde.com IDE for Abaqus Subroutines

https://ddsdde.com/
1•white_tiger•4m ago•1 comments

Microsoft's Quantum Chief Doesn't Care That Scientists Don't Believe His Results

https://www.wired.com/story/microsoft-quantum-chief-majorana-results/
1•Brajeshwar•4m ago•0 comments

A model-agnostic AI coding harness that puts unskippable gates into Git

https://github.com/beausee/coniunctio-intelligentiarum
1•beausee•4m ago•0 comments

A Polynomial-Time Quantum Algorithm for the Dihedral Coset Problem [Draft] [pdf]

https://eprint.iacr.org/2026/1591.pdf
2•connorboyle•6m ago•0 comments

Show HN: Ranking weather models by how their forecasts turned out

https://nickleenders.github.io/verisky-scoreboard/?city=newyork
4•nickoteeno•7m ago•0 comments

You Don't Want to Time Travel

https://dgilesphd.substack.com/p/no-you-dont-want-to-time-travel
2•speckx•9m ago•0 comments

The Crypto Clarity Act on the Brink of Political Collapse

https://optimustrend.blogspot.com/2026/08/opinion-recap-crypto-clarity-act-on.html
2•AllForAll•10m ago•0 comments

Memory Safety Is a Useless Concept

https://gist.github.com/manikndn-m/cc820394c0f02f33cf70f96a00ba2451
2•gooooood•10m ago•0 comments

Why Feature Flags Become Permanent Infrastructure Debt

https://medium.com/@yalovoy/why-feature-flags-become-permanent-infrastructure-debt-d4f4a7975180
1•zero-ground-445•11m ago•0 comments

Reconciling state pensions from N countries into one retirement estimate

https://www.expatrimony.com/
1•mint_cloud•14m ago•0 comments

Data center doubt: Why Florida is pushing back against hyperscale development

https://therealdeal.com/miami/2026/08/06/ai-driven-data-center-boom-hits-local-opposition-in-flor...
2•mapping365•14m ago•1 comments

I added a real-time chat to my blog, people used it to attack me

https://en.andros.dev/blog/b6c32a90/i-added-a-real-time-chat-to-my-blog-people-used-it-to-attack-me/
3•andros•15m ago•0 comments

Reinventing Entropy – Compression is Intelligence Part 1 [video]

https://www.youtube.com/watch?v=l6DKRf-fAAM
1•rzk•15m ago•0 comments

Proposed land ban puts $100B Kentucky data center in Democrats' crosshairs

https://www.kentucky.com/news/politics-government/article316774362.html
1•mapping365•16m ago•0 comments

In Google, 30k computer scientists search a single software engineer

https://softwareengineeringexperiences.quora.com/Should-we-call-developers-working-at-FAANG-compa...
1•USTECH_WORKER•17m ago•0 comments

Ohio Assembly members propose bill to regulate data center development

https://ohiocapitaljournal.com/2026/08/06/ohio-general-assembly-members-propose-sweeping-bill-to-...
1•mapping365•17m ago•0 comments

AI Agents Think and Act: ReAct in 2 Minutes

https://vinithavn.substack.com/p/how-ai-agents-think-and-act-react
2•vinithavn01•18m ago•0 comments

Git Explain TUI – Explore Commits and Chat with Diffs

https://mmcs-work.github.io/git-explain-tui/
1•nemo_captain•18m ago•0 comments

American farmers slid solar panels over 62,000 acres of farmland

https://energiesmedia.com/solar-panels-farmland-crops-agrivoltaics/
1•speckx•19m ago•0 comments

Open-source agentic satellite anomaly detector with calibrated confidence

https://github.com/adoviguerav/esa-adb-trustworthy-agent
1•adoviguera•19m ago•0 comments

Show HN: React Candlesticks – JSX composable Canvas charts for financial UIs

https://reactcandlesticks.com/demo/
1•jjjww•20m ago•0 comments

Show HN: Line9 - a Mermaid rendering engine with its own layout

https://line9.ai/diagram
1•jumpalongjim•20m ago•0 comments

A Portland Company Can Put Your Favorite Mixtape on Vinyl

https://www.wweek.com/culture/2026/05/05/a-portland-company-can-put-your-favorite-mixtape-on-vinyl/
1•voxadam•20m ago•0 comments

Drift, your new favorite Git Diff tool

https://github.com/aymanbagabas/drift
2•aymanbagabas•21m ago•0 comments

Why good developers should avoid working for Google

https://www.quora.com/What-are-the-disadvantages-of-working-at-Google/answer/Rob-Menke?ch=15&oid=...
1•USTECH_WORKER•22m ago•0 comments