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

AI Is Making Silicon Valley Productive, Anxious and Afraid to Log Off

https://www.bloomberg.com/news/articles/2026-06-26/ai-anxiety-is-fueling-burnout-across-silicon-v...
1•uzyn•1m ago•0 comments

The human eye may hold the fix for self-driving cars

https://newatlas.com/technology/eye-inspired-photomemristor-self-driving-cars/
1•breve•2m ago•0 comments

I wrote a free book about Scripture, AI, and language

https://wordnamefire.com/
1•seomister7•2m ago•0 comments

Pollen tried to remove my article and Google is assisting

https://blog.pragmaticengineer.com/pollen-tried-to-remove-my-article-about-callum-negus-fancey-an...
1•lolinder•10m ago•0 comments

Attention is all we have

https://davidbessis.substack.com/p/attention-is-all-we-have
1•gmays•10m ago•0 comments

Exposed DB, Exposed Credentials, Exposed KEV Exposures, Subdomain Takeover

1•gladiator291288•15m ago•0 comments

Annotation and the Malleability of Software

https://azlen.me/stories/annotation-story/
1•handfuloflight•16m ago•0 comments

Study highlights CERN's socio-economic contributions as a global research hub

https://home.cern/new-study-highlights-cerns-socio-economic-contributions-as-a-global-research-hub/
1•visha1v•19m ago•0 comments

A plane crashed into tallest skyscraper in Beijing.Hours later,all news scrubbed

https://www.cnn.com/2026/06/27/china/beijing-plane-crash-citic-tower-censorship-china-intl-hnk
2•Markoff•19m ago•2 comments

You can export/import passkeys now, but only on iOS

https://danfabulich.medium.com/you-can-export-import-passkeys-now-but-only-on-ios-3b90cddf5fe6
1•dfabulich•20m ago•0 comments

Virtual AI police chief introduced in Osaka amid rising imposter scams

https://mainichi.jp/english/articles/20260627/p2g/00m/0na/029000c
1•rawgabbit•28m ago•0 comments

Make Reality Answer [pdf]

https://hari.computer/book.pdf
4•markovblanket•35m ago•3 comments

Working around dragons with the Lemote Yeeloong laptop and OpenBSD

http://oldvcr.blogspot.com/2026/06/working-around-dragons-with-lemote.html
3•classichasclass•38m ago•0 comments

Alzheimers: The undiscovered country from whose bourn no traveler returns (2007)

https://www.rogerebert.com/reviews/away-from-her
2•walterbell•39m ago•0 comments

AI Realtime Commentator for the World Cup

https://twitter.com/zicohacks/status/2070401037018788301
4•aurenvale•44m ago•0 comments

The Unglamorous Side of Rust Web Development

https://blog.jetbrains.com/rust/2026/06/25/rust-web-development-2026/
7•vilasa•48m ago•1 comments

Ketogenic diets slow melanoma growth in vivo

https://link.springer.com/article/10.1186/s40170-022-00288-7
3•koolba•49m ago•2 comments

Improved LLM as a Judge Techniques

https://arxiv.org/abs/2606.27226
2•haritha1313•56m ago•0 comments

GSD – Open-source, local-first task manager built on the Eisenhower matrix

https://gsdtaskmanager.com/
2•vscarpenter•1h ago•0 comments

We can't retrain our way out of AI's economic disruption

https://mollykinder2.substack.com/p/we-cant-retrain-our-way-out-of-ais
2•keeda•1h ago•0 comments

Ford hired AI and sacked humans. It backfired badly

https://www.the-independent.com/tech/ford-ai-automation-human-workers-b3003787.html
33•speckx•1h ago•7 comments

Monlite – documents, vectors, cache, and job queue in one SQLite file

https://github.com/qataruts/monlite
4•emadjumaah•1h ago•0 comments

Bypass Protocol: The NDC Architecture Middleware Trap

https://www.youtube.com/watch?v=d4yvhpcXAzU
2•tgold8888•1h ago•0 comments

Show HN: Git-temp – scratchpad folder for AI agents; doesn't clutter Git status

https://github.com/sebmellen/git-temp
3•sebmellen•1h ago•0 comments

Deburr Edge Cases Skill: Make coding agents systematize their local code

https://github.com/imbue-ai/rust-bucket/blob/main/.agents/skills/deburr-edge-cases/SKILL.md
2•nvader•1h ago•0 comments

Yap – free offline voice dictation for Mac/Windows/Linux (Wispr Flow alt)

https://github.com/AkuchiS/yap
3•AkuchiS•1h ago•0 comments

Powerful Anthropic model, Fable 5, on track to return soon

https://www.axios.com/2026/06/27/anthropic-fable-5-return-soon
3•chris_overseas•1h ago•0 comments

An argument with Om about Wired spawned this newsletter. RIP brother

https://crazystupidtech.com/2026/06/27/how-an-argument-with-om-spawned-this-newsletter-rip-brother/
2•rmason•1h ago•0 comments

Marfa Public Radio Puts You to Sleep

https://www.marfapublicradio.org/podcast/marfa-public-radio-puts-you-to-sleep
72•reaperducer•1h ago•11 comments

A Man Who Invented a Surgery to Cure Himself

https://medium.com/swlh/doug-lindsay-the-man-who-cure-himself-12d40d3f643e
3•raynchad•1h ago•0 comments