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 Hideous Duty of Isaiah Berlin [pdf]

https://berlin.wolf.ox.ac.uk/lists/onib/kemper.pdf
1•jruohonen•34s 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/
1•SerCe•1m ago•0 comments

Best Fonts for Programming in 2026

https://draculatheme.com/blog/best-fonts-for-programming-2026
1•luxonauta•1m ago•0 comments

Synesthesia

https://en.wikipedia.org/wiki/Synesthesia
1•FergusArgyll•1m ago•0 comments

Show HN: Openvisor – A Session Explorer for OpenCode

https://openvisor.vercel.app/
1•shadeslayer_•3m ago•0 comments

Backfills should fail in minutes, not days

https://will-keleher.com/posts/backfills-should-fail-in-minutes-not-days/
1•speckx•4m ago•0 comments

Don't Use Ordinary Software to Contain Software-Hacking Agents

https://verse.systems/blog/post/2026-07-24-dont-use-software-to-contain-software-hacking-agents/
1•matt_d•4m ago•0 comments

X Money released to Premium and Premium+ users in the US

https://money.x.com/en
1•wtsnz•4m ago•1 comments

Show HN: A 538-style dashboard for upcoming Knesset elections

https://theelectiondashboard.com/
1•AzariaK•7m ago•0 comments

Do you hide your AI behind a curtain?

https://similaritiesengine.com/
1•BubbleRings•8m ago•2 comments

Managing Critical Isotopes: DOE Could Better Assess Market Needs

https://www.gao.gov/products/gao-26-108053
1•Jimmc414•8m ago•0 comments

Administration Demands Hospitals Share Emergency Room Records

https://kffhealthnews.org/health-industry/cpsc-consumer-product-safety-commission-trump-er-injury...
1•Jimmc414•9m ago•0 comments

A Dinner on What It Means to Write Science

https://chillphysicsenjoyer.substack.com/p/a-dinner-on-what-it-means-to-write
1•crescit_eundo•10m ago•0 comments

Birding Like It's 1899: Inside a Blockbuster American West Video Game (2019)

https://www.audubon.org/news/birding-its-1899-inside-blockbuster-american-west-video-game
1•eatonphil•10m ago•0 comments

OCR accuracy: 100% & Fraud: 100 % – AI vs. template based fraud

https://idp-software.com/news/the-100-dollar-forgery/
2•chelm•11m ago•0 comments

Conversation and Context in an Online World

https://blog.apaonline.org/2026/07/27/conversation-and-context-in-an-online-world/
1•jruohonen•12m ago•0 comments

Sharden Mine (no competition) Alchemy free-tier ~65k rounds Snapdragon870 termux

https://github.com/babakkarimib/sharden-miner
1•Sharden•14m ago•0 comments

Things I would like to tell my 10 year old self

https://winnielim.org/journal/things-i-would-like-to-tell-my-10-year-old-self/
2•speckx•16m ago•0 comments

Parents 'driven to suicide' by wrong orders to pay child maintenance

https://www.thetimes.com/money/family-finances/article/parents-suicide-wrong-orders-child-mainten...
2•bbg2401•18m ago•1 comments

Why China is giving away its best AI models

https://www.theverge.com/ai-artificial-intelligence/971444/how-chinese-open-weight-ai-models-impa...
1•saikatsg•19m ago•0 comments

Why budding birders are flocking to Shazam-like apps to identify avians

https://www.bbc.com/news/articles/cr59m5nmemno
1•saikatsg•21m ago•1 comments

Sheepview360 (2016)

https://visitfaroeislands.com/en/about-vfi/marketing-development-campaigns/sheepview360
1•KomoD•22m ago•0 comments

If You're over 40, You're Ready to Use A.I

https://www.nytimes.com/2026/07/27/opinion/teaching-kabbalah-ai.html
3•apparent•23m ago•0 comments

The Rosenberg Boys

https://www.theatlantic.com/magazine/2026/08/ethel-julius-rosenberg-boys/687631/
1•gmays•24m ago•0 comments

Devastating European wildfires in maps – and how they're being tackled

https://www.bbc.com/news/articles/cj638jx0l53o
2•saikatsg•24m ago•0 comments

OpenTakeoff – Open-source browser engine for construction takeoff

https://github.com/Kentucky-ai/opentakeoff](https://github.com/Kentucky-ai/opentakeoff
1•kentucky-ai•24m ago•0 comments

We achieved 94.7% in Longmemeval built in a hackathon, everything open sourced

https://github.com/kunal12203/swafra
1•krishnakantk876•24m ago•0 comments

Naturally Occurring Abstract Art of New York City

https://www.mojmali.com/article/naturally-occurring-abstract-art-nyc
1•Mojmalik•25m ago•0 comments

Our company runs out of a folder

https://www.insideainative.com/p/our-company-runs-out-of-a-folder
2•mmayernick•26m ago•0 comments

XLights Is a Sequencer for Lights

https://github.com/xLightsSequencer/xLights
1•gregsadetsky•26m ago•0 comments