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

The Uses of 'Treason'

https://www.cjr.org/the_media_today/the-uses-of-treason-donald-trump-press-traitors-air-force-one...
1•robtherobber•50s ago•0 comments

Ask HN: What do you use local models for?

1•tjomk•3m ago•0 comments

7.1 Earthquake in Japan

https://www.data.jma.go.jp/multi/quake/quake_detail.html?eventID=20260728163528&lang=en
2•krembo•4m ago•0 comments

Seriously, what is the large code-model even for?

https://fzakaria.com/2026/07/26/seriously-what-is-the-large-code-model-even-for
1•birdculture•6m ago•0 comments

Show HN: Reverse-engineer viral videos into AI-ready shot breakdowns

https://videolens.cc/zh/landing
1•not_wowinter13•10m ago•0 comments

Show HN: Dino Race – A peer-to-peer two-player Chrome Dino game

https://gameplayer2.com/dino
1•dares2573•10m ago•0 comments

Artificial Intelligence: Shades of Gray

https://changelog.complete.org/archives/42503-artificial-intelligence-shades-of-gray
1•psibi•11m ago•0 comments

Does Speaking to Agents Like Cavemen Save 65% of Tokens? We Test

https://blog.jetbrains.com/ai/2026/07/speak-to-ai-agents-like-cavemen-tosave-tokens/
2•Sandman•11m ago•0 comments

Disney+ removes 4K and HDR from premium plans in Germany

https://www.heise.de/en/news/Disney-4K-and-HDR-completely-disappeared-in-Germany-11379707.html
2•Vloeck•16m ago•0 comments

Fcgc

https://news.ycombinator.com/submit
1•sfgsfsdgs•16m ago•0 comments

Packaging Companies in Sri Lanka

https://akhtarigroup.com/
1•jayanath99•22m ago•0 comments

AgentEnv

https://github.com/kvcache-ai/AgentEnv
1•handfuloflight•24m ago•0 comments

Show HN: Kimi K3 Is Now Live on Canopy Wave

https://canopywave.com/models/kimi-k3
2•Rossmax•27m ago•0 comments

Show HN: WhimPop – A macOS menu that pops up under your cursor

https://whimpop.com/
1•whimbyte•27m ago•0 comments

Show HN: Turo – Tagalog for point, saves Tokens by pointing instead of talking

https://github.com/kdeps/turo
1•jjuliano•28m ago•0 comments

Sodium restriction and insulin resistance: A review of 23 clinical trials

https://journalofmetabolichealth.org/index.php/jmh/article/view/78/242
1•sublinear•32m ago•0 comments

Microsoft Sam starts his car

https://www.youtube.com/watch?v=EQ1LbeaU_LI
2•nazgulsenpai•33m ago•0 comments

Exercises in benchmarking and evals, part 7

https://danluu.com/exercise-7/
1•janvdberg•34m ago•0 comments

Small and mid-sized businesses are managing Android devices without Google

https://www.msn.com/en-xl/news/other/how-small-and-mid-sized-businesses-are-managing-android-devi...
1•erkin_bek•39m ago•0 comments

KDE daemon – the annoying restart is needed to complete update

https://www.dedoimedo.com/computers/kde-system-notification-helper.html
1•coisasdavida•39m ago•1 comments

Shown HN: Mathend – Microsoft Word but less annoying

https://mathend.com
1•muhamsyaddad•41m ago•1 comments

Microsoft unveils AI security tools it says outperform competing platforms

https://arstechnica.com/security/2026/07/microsoft-unveils-ai-security-tools-it-says-outperform-c...
4•joozio•46m ago•0 comments

Final hurrah? Glasgow's cut-price Commonwealth Games fight for survival

https://www.lbc.co.uk/article/anyone-still-care-commonwealth-games-glasgow-opinion-5Hjdf6S_2/
3•austinallegro•48m ago•0 comments

Cracking the code: can AI help us decipher ancient languages?

https://theconversation.com/cracking-the-code-can-ai-help-us-decipher-ancient-languages-288238
2•zeristor•49m ago•0 comments

Open Source Must Be Fun (Or It Will Die)

https://mikemcquaid.com/open-source-must-be-fun-or-it-will-die/
1•robin_reala•50m ago•0 comments

Evals before prompts: building an LLM OCR for KYC

https://blog.nilenso.com/blog/2026/05/18/evals-before-prompts-building-an-llm-ocr-for-kyc/
1•priyangapkini•51m ago•0 comments

Facebook now wants a selfie video of your face, too

https://blog.mega.io/facebook-verified-selfie
3•dotcoma•55m ago•0 comments

Three certificates, one domain, three lost launch days

https://www.certpost.ai/blog/three-certificates-three-lost-launch-days
1•mlmusson•59m ago•0 comments

AI 'tokenmaxxing' fades as workplaces look to cut tech spending

https://apnews.com/article/ai-token-openai-anthropic-corporate-31bb80ac1cd7862d05f6397177d826b1
7•geox•1h ago•1 comments

A Proposal for a Universal Moral Core

https://continuations.com/a-proposal-for-a-universal-moral-core
1•imartin2k•1h ago•0 comments