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

Objective – Tickets, file claims, and proof gates for coding agents

https://github.com/rakeshutekar/Objective
1•rakeshutekar•1m ago•0 comments

Show HN: Martin, A CLI that let's your Agent be your CRM, Built on Jaybase

https://github.com/kyle-visner/martin
1•kvisner•2m ago•0 comments

Show HN: DashClaw

https://www.dashclaw.io
1•ucsandman•3m ago•0 comments

Why China's A.I. Models Could Threaten the Communist Party

https://www.nytimes.com/2026/07/30/world/asia/as-chinas-ai-gets-stronger-it-poses-new-risks-to-be...
1•bookofjoe•3m ago•1 comments

Civilians under siege by Mexican cartel fight back with AK-47s, grenades

https://www.pbs.org/newshour/world/civilians-that-were-under-siege-by-a-mexican-cartel-fight-back...
2•starkparker•5m ago•0 comments

Do It 14,000 Times Slower with This One Trick

https://semi-rad.com/2026/08/do-it-14000-times-slower-with-this-one-trick/
1•frizlab•6m ago•0 comments

Hackers using calls, websites, meticulous tactics targeting US financial firms

https://www.reuters.com/world/hackers-targeted-us-private-equity-other-firms-including-blackstone...
2•Terretta•6m ago•0 comments

Unlimited text chats with GPT-5.6 Luna for everyone

https://twitter.com/openai/status/2085434712429052386
1•wertyk•7m ago•0 comments

Design of 1 TWe Fusion Power Plant

https://medium.com/@alanse/design-of-1-twe-fusion-power-plant-1ed9cea853d8
1•AlanSE•7m ago•0 comments

Astronomers capture highest-resolution image ever of the Sun's surface

https://physicsworld.com/a/astronomers-capture-highest-resolution-image-ever-of-the-suns-surface/
5•layer8•8m ago•0 comments

The Long Tail Gets Longer and Fatter

https://talkshi.com/blog/long-tail-gets-longer-and-fatter
1•greenfish6•11m ago•0 comments

Designing a query system for a Rust compiler

https://bal-e.org/speed/krabby/2026/query-system-design/
2•fanf2•11m ago•0 comments

Anthropic will design its own hardware to power Claude

https://arstechnica.com/ai/2026/08/anthropic-confirms-plans-to-build-an-in-house-silicon-team/
2•wertyk•13m ago•1 comments

Caveman Science Fiction

https://dresdencodak.com/2009/09/22/caveman-science-fiction/
1•erhuve•14m ago•0 comments

The original Quake gets a new DLC 30 years after its release

https://twitter.com/bethesda/status/2085427784210317743
1•aggrrrh•14m ago•1 comments

Some Moral and Technical Consequences of Automation (1960) [pdf]

https://www.cs.umd.edu/users/gasarch/BLOGPAPERS/moral.pdf
1•RGS1811•14m ago•0 comments

Google Gemini seems to expose private Google Docs data

https://www.reddit.com/r/IndieDev/comments/1vfwuf5/a_player_found_out_the_actual_name_of_my_games/
1•mostlysimilar•14m ago•1 comments

AI used to design new viruses

https://www.eurekalert.org/news-releases/1138470
2•DeepLogin•14m ago•0 comments

Should AI labs be treated like the owners of dangerous animals?

https://www.economist.com/science-and-technology/2026/08/06/should-ai-labs-be-treated-like-the-ow...
1•pseudolus•15m ago•1 comments

The End of Google Search—and the Internet—as We Know It

https://www.theringer.com/2026/08/04/tech/google-search-ai-internet
1•CharlesW•16m ago•0 comments

GitHub exposes pub keys at GitHub .com/${username}.keys

https://twitter.com/samhogan/status/2085380716163109265
3•gmays•18m ago•0 comments

ASK HN: Opus 5.0 is more autonomous

1•nunep•19m ago•2 comments

Agent Skills

https://github.com/addyosmani/agent-skills
1•tosh•19m ago•0 comments

Gemma Translator: DIY hardware for offline translation

https://github.com/google-gemma/gemma-translator
1•dmotz•19m ago•0 comments

Win Grep – A visual 3-pane log and text filtering tool for Windows

https://www.sharktime.com/en_WinGrep.html
1•piotrchlebek•20m ago•0 comments

AI Creates Bacteria-Killing Viruses: 'Extreme Caution' Warns Genome Pioneer

https://www.newsweek.com/ai-creates-bacteria-killing-viruses-extreme-caution-warns-genome-pioneer...
2•_____k•20m ago•0 comments

Anomaly

https://anomaly.cnetai.cyou
1•anoqwen•23m ago•0 comments

Show HN:Calibra: Train with Less Data

https://calibra-wulw.vercel.app/
1•omertt27•24m ago•0 comments

The Complexity We Choose

https://frazik.com/blog/2026/the-complexity-we-choose/
1•frazik•24m ago•0 comments

Kimi K3 is now available in GitHub Copilot

https://github.blog/changelog/2026-08-06-kimi-k3-is-now-available-in-github-copilot/
2•theanonymousone•26m ago•0 comments