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

My Last 7 Days with Fable

https://zhenyi.gibber.blog/my-last-7-days-with-fable
1•zhenyi•39s ago•0 comments

Website for Live Terminal Streaming

https://sl0p.foo/
1•notmine1337•1m ago•0 comments

Scientists demonstrate solar-powered plastic recycling at real-world scale

https://www.cam.ac.uk/research/news/scientists-demonstrate-solar-powered-plastic-recycling-at-rea...
1•thunderbong•2m ago•0 comments

Show HN: PAI, a Linux-y personal-assistant for Mac

https://www.whitematterlabs.ai/
1•ardatasci•6m ago•0 comments

NASA launches robot to save Swift telescope falling to Earth

https://www.bbc.com/news/articles/c0ry4xx7rk8o
1•msadowski•9m ago•0 comments

Show HN: GhostMap – structured ghost annotations for VS Code

https://marketplace.visualstudio.com/items?itemName=Ghostmap.ghostmap
1•milovale•9m ago•0 comments

A Speed Limit for Computers

https://caolan.uk/notes/2026-07-02_a_speed_limit_for_computers.cm
1•birdculture•10m ago•0 comments

I got shadowbanned building a Reddit tool

https://cuescout.com/blog/i-got-shadowbanned-building-a-reddit-tool
1•tgdaimov•16m ago•1 comments

ESM sees euro zone recession if US sell-off, new Middle East war hit at once

https://www.reuters.com/business/finance/esm-sees-euro-zone-recession-if-us-sell-off-new-middle-e...
2•adithyaharish•18m ago•0 comments

I built a more efficient way to give charity

https://tithe.charity/
1•asherworks•19m ago•0 comments

Vacuum at the Page Level

https://boringsql.com/posts/vacuum-at-the-page-level/
2•radimm•20m ago•0 comments

'A lot of our parents were paid by the hour'

https://www.theguardian.com/lifeandstyle/2026/jun/22/money-coach-blueprint-generational-wealth
1•bookofjoe•21m ago•0 comments

Democratizing Abandonware

https://geopjr.dev/blog/democratizing-abandonware
2•latexr•26m ago•0 comments

Research "junkification" is caused by researchers, not journals

https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2026.1845947/full
1•giuliomagnifico•27m ago•0 comments

Is Starlink a Secret Radar Constellation? [video]

https://www.youtube.com/watch?v=jbp3kdJZ1_A
1•TMWNN•28m ago•0 comments

Tell HN: Error: Claude-fable-5 is temporarily unavailable

2•throwaw12•29m ago•1 comments

Show HN: An always-fresh memory that learns your repo, so agents stop re-reading

https://github.com/shofer-dev/claude-code-live-memory
1•alsterg•32m ago•0 comments

OpenCRA

https://github.com/borisRadonic/OpenCRA
1•BorisRadonic•32m ago•0 comments

The Math Behind Harmony – why a fifth sounds sweet and a piano is tuned wrong

https://m-ric.com/blog/math-of-harmony/
1•aubanel•36m ago•0 comments

List of Humorous Units of Measurement

https://en.wikipedia.org/wiki/List_of_humorous_units_of_measurement
5•pchr8•39m ago•1 comments

Show HN: Explain this – agent skills to create HTML explainer for topics or code

https://github.com/analyticalmonk/explain-this/
3•akashtndn•41m ago•0 comments

Show HN: Adkumo – Marketing Agent for SaaS

https://www.adkumo.com
1•gustavoauma•43m ago•0 comments

Real-time map of Great Britain's rail network

https://www.map.signalbox.io
40•scrlk•44m ago•11 comments

SW Agent – an outbound-only connector for browser-based PostgreSQL IDEs

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

Bad Epoll (CVE-2026-46242)

https://github.com/J-jaeyoung/bad-epoll
3•birdculture•48m ago•0 comments

Show HN: ScreenCI – Always up-to-date product videos from E2E tests

https://screenci.com/
4•ollipal•56m ago•0 comments

Reliability Issues with Jira and Confluence

https://jira-software.status.atlassian.com
1•amaccuish•56m ago•0 comments

LinguaHover – Hover Any Word, Translate Instantly – Chrome Extension

https://chromewebstore.google.com/detail/linguahover-translator-pr/dnkpfkopeeilpfgnehheceebamlcbcgc
1•titan_tokyo•1h ago•0 comments

Show HN: Mochi Analytics

https://www.mochianalytics.com
2•devtanna•1h ago•0 comments

In the Weights

https://intheweights.com
1•dash2•1h ago•0 comments