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

If another civilisation lived on Earth before us, would we know?

https://www.rnz.co.nz/news/world/801858/if-another-civilisation-lived-on-earth-before-us-would-we...
3•billybuckwheat•1m ago•0 comments

Show HN: OpenSlides – Open-source desktop app for animated code presentations

https://github.com/codewiththiha/OpenSlides
1•codewiththiha•4m ago•0 comments

An agent with write access to my files, and no way to send them anywhere

https://manazir.dev/work/mnzrbrain-secondbrain-part-two
1•mnzrdev•5m ago•0 comments

Tokenflation: When "Hi" triggers 33 tool calls

https://quesma.com/blog/tokenflation-when-hi-triggers-33-tool-calls/
2•jakozaur•10m ago•0 comments

MinHash – How to Find Similarity at Scale

https://spotintelligence.com/2023/01/02/minhash/
1•ankitg12•12m ago•0 comments

Source Code Grep: Use your own grep, but make it source code aware

https://github.com/m-manu/scgrep
1•m-manu•13m ago•1 comments

Show HN: ScreenFocus – keyboard focus follows the pointer across Mac displays

https://github.com/therohitdas/ScreenFocus
1•therohitdas•18m ago•0 comments

Choose Boring Technology

https://boringtechnology.club/
1•ustad•18m ago•0 comments

Show HN: VoiceScroll – a teleprompter that scrolls as you speak

https://www.voice-scroll.com
1•sangkwun•21m ago•0 comments

Best Window Air Conditioners of 2026: Midea, Zafro, GE

https://www.wired.com/gallery/best-window-air-conditioners/
1•joozio•23m ago•0 comments

Connection-Agnostic Presence Tracking for Stateless Distributed Back Ends

1•duckydude20•24m ago•0 comments

Show HN: Inflect TTS v2+ONNX, 9M/4M text-to-speech models running in the browser

https://inflect-tts.geronimo-labs.com
2•g58892881•27m ago•2 comments

Skateboarding Forum on Wood Quality

https://www.slapmagazine.com/index.php?topic=120409.0
2•marysminefnuf•28m ago•0 comments

Ask HN: Is Your Work Relaxing?

1•julienreszka•30m ago•0 comments

Sequentialising Parallel Moves

https://compiler.club/parallel-moves/
1•g0xA52A2A•35m ago•0 comments

Show HN: Mousecrack – Bypass agent mouse detection with deep learning

https://github.com/puffinsoft/mousecrack
1•G3819•39m ago•0 comments

Show HN: Pg_stat_ch, a Postgres extension to export every metric to ClickHouse

https://github.com/ClickHouse/pg_stat_ch
1•saisrirampur•44m ago•0 comments

WezTerm Config Guide

https://gilbertsanchez.com/posts/my-terminal-wezterm/
1•ankitg12•45m ago•0 comments

Stack Overflow for Agents

https://stackoverflow.blog/2026/06/10/announcing-stack-overflow-for-agents/
1•taubek•47m ago•0 comments

LaunchRanks – Get actionable SEO steps for growing site authority

https://launchranks.com
1•NataliNy•53m ago•0 comments

Show HN: Record a click-through demo from a Markdown plan into one HTML file

https://github.com/justrinari/handoff
3•justrinari•55m ago•0 comments

Show HN: I built an AI that roasts GitHub profiles

https://gitroast-kappa.vercel.app/
3•hito20•57m ago•1 comments

Vision 50 Years Phone – Keeping old Android phones fast without root

https://github.com/50YearsPhone/vision-50-years-phone
2•mike5gao•58m ago•0 comments

Eve.dev: Next.js for Agents

https://eve.dev/
1•javiercr•58m ago•0 comments

Hans Moravec was right about AI

https://nymag.com/intelligencer/article/hans-moravec-interview.html
1•anath2•1h ago•0 comments

Watching Go's new garbage collector move through the heap

https://theconsensus.dev/p/2026/07/19/observing-gos-garbage-collector-old-and-new.html
2•ksec•1h ago•0 comments

GrapheneOS duress PIN could land a man in prison

https://www.androidauthority.com/grapheneos-duress-pin-us-prosecution-3691271/
2•kitd•1h ago•0 comments

The Algorithmic Atelier

https://www.doc.cc/articles/the-algorithmic-atelier
1•kaizenb•1h ago•0 comments

Operating a computer with your tongue: the Augmental MouthPad [video]

https://www.youtube.com/watch?v=xReyIF5pwRo
1•jibcage•1h ago•0 comments

'Who wants to be hired' now outnumbers 'Who is hiring'

https://ej29-r3d.github.io/hacker-news-hiring-trends/
3•Tronickle•1h ago•1 comments