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

MCP server for 340k SVG icons

https://github.com/LeulAria/Aria-Icons
1•leularia•3m ago•0 comments

Urban congestion relief experiments through routing-app interventions

https://www.nature.com/articles/s44284-026-00443-x
1•neehao•4m ago•0 comments

Tesla killing Solar Roof is leaving installers with six-figure losses

https://electrek.co/2026/09/01/tesla-solar-roof-exit-installers-losses/
4•voxadam•12m ago•0 comments

Selected GitHub Copilot models deprecated

https://github.blog/changelog/2026-08-31-selected-github-copilot-models-deprecated/
1•mooreds•14m ago•0 comments

My Mac Mini fits one model. I run five

https://placona.co.uk/my-mac-mini-fits-one-model/
3•makaimc•15m ago•0 comments

Replaceable but Employed: Automation and the Meaning of Work

https://www.nber.org/papers/w35559
2•mooreds•15m ago•0 comments

AI Cold Showers

https://allan.reyes.sh/posts/ai-cold-showers/
2•mooreds•16m ago•0 comments

US Military disabled ad tracking on troops' devices after targeted attacks

https://techcrunch.com/2026/09/04/us-military-disabled-ad-tracking-on-troops-devices-following-re...
5•jethronethro•17m ago•0 comments

Decoherence: A card game for two based on quantum physics

https://decoherance.vaguespac.es/
1•thebigship•19m ago•0 comments

Scaling Engineering: Ownership over Hiring

https://greenido.dev/2026/06/11/what-changes-at-20-50-and-200-engineers/
1•fagnerbrack•21m ago•0 comments

Free WhatsApp abandoned cart recovery for WooCommerce

https://wordpress.org/plugins/6rsh-messaging-notifications/
1•sixrsh•21m ago•0 comments

Botsitting: The Unpaid Labour Behind Every AI Productivity Claim

https://smarterarticles.co.uk/botsitting-the-unpaid-labour-behind-every-ai-productivity-claim
1•dxs•22m ago•0 comments

Code at the Speed of Understanding

https://dennisy.me/notes/code-at-the-speed-of-my-understanding
1•dennisy•23m ago•0 comments

Secret Collusion Among AI Agents

https://arxiv.org/abs/2402.07510
2•phaseonebig•24m ago•0 comments

Amy – high performance fixed-point music synthesizer library

https://github.com/shorepine/amy
1•anigbrowl•24m ago•0 comments

Show HN: Animating code snippets from first principles

1•rahulrav•25m ago•0 comments

Show HN: Expose - a self-hosted tunneling tool like ngrok/localtunnel(Golang)

https://github.com/kernelshard/expose
2•samiulsk•26m ago•0 comments

Alzheimer's treatment is advancing rapidly

https://www.vox.com/the-highlight/501710/alzheimers-disease-dementia-test-treatment-medication-in...
2•dabinat•26m ago•1 comments

The Foundations of Modern AI: Generalization, Data Selection, and Epiplexity

https://www.youtube.com/watch?v=lKoJJxjUfdw
1•E-Reverance•27m ago•0 comments

Ask HN: How do you know a prompt is "complex" for an AI model?

1•faryadz•27m ago•0 comments

CPAN Uploads Are Up 50% Year-over-Year

https://www.olafalders.com/2026/09/04/cpan-uploads-up-50-percent-year-over-year/
1•Amorymeltzer•29m ago•0 comments

Watch Los Angeles get built, one building at a time (1880–2026)

https://lax-skyline.parcelscope.net/
27•rustywasm•29m ago•8 comments

"Twenty years of brand building froze in time": How coding agents select tools

https://thenewstack.io/coding-agents-tool-choice/
2•theanonymousone•29m ago•0 comments

The Context Engine

https://productnow.ai/blogs/the-context-engine
1•kadhirvelm•29m ago•1 comments

Agentic Coding in the Wild

https://kstark007.github.io/blog/agentic-coding-in-the-wild/
2•maknee•30m ago•0 comments

All 32 NFL stadiums ranked by total game day cost

https://visityourteam.com/nfl/rankings/game-day-costs
1•brambleworks•42m ago•0 comments

Senate Considers Letting Contractors Hack Computers for Military

https://www.bloomberg.com/news/articles/2026-09-03/senate-considers-allowing-contractors-to-condu...
3•_____k•43m ago•0 comments

OSB Runs locally on Mobile Devices, now we are Fundraising

https://whydonate.com/fundraising/seeking-startup-funding
1•opensb•45m ago•1 comments

The Appeal

https://sunilpai.dev/posts/the-appeal/
1•tosh•45m ago•0 comments

Show HN: MobileCode – OpenCode with React Native Previews

https://github.com/hsandhu/mobilecode
2•rsandhu•45m ago•0 comments