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 MATRIX – 1950's Super Panavision 70 [video]

https://www.youtube.com/watch?v=APZ6ycET5WY&list=PL3chMvVbsupSzQrk-lJBS8cpdIfGDbJfc&index=9
1•Bluestein•1m ago•0 comments

Columbia House, Mail-Order Media Company, Is Shuttering

https://consequence.net/2026/08/columbia-house-closing-down/
1•speckx•2m ago•0 comments

Looking for Cofounder in Legaltech

https://santol.finance
1•bgajjela•2m ago•0 comments

Star Wars: A New Hope – A Visual Guide to Changes in the Disney+ 4K Version

https://thedigitalbits.com/features/articles/item/2144-sw-new-hope-disneyplus-4k-2019
1•dabber•4m ago•0 comments

Why the IBM PCjr Failed: The "Peanut" Disaster Stan Veit Ch. 24 [video]

https://www.youtube.com/watch?v=BBem-H6ZLtY
1•oldnetguy•4m ago•0 comments

Cursor: Chat is all you need

https://twitter.com/mattyp/status/2089758434921160877
1•tosh•4m ago•0 comments

Ideating Tragit

https://figbert.com/posts/ideating-tragit/
1•Bluestein•6m ago•0 comments

macOS Data Protection Keychain for Electron Apps

https://github.com/biw/keychain-store
1•biwills•9m ago•0 comments

Data centers raise nearby temperatures by up to 4 degrees in Phoenix

https://asmedigitalcollection.asme.org/sustainablebuildings/article/7/2/024501/1233035/Data-Cente...
2•cwwc•9m ago•0 comments

AI chip startup Etched doubles valuation to $21B in under a month

https://www.reuters.com/technology/ai-chip-startup-etched-valued-21-billion-latest-funding-round-...
1•porridgeraisin•11m ago•1 comments

How Wall Street Sussed Out That Situational Awareness Was on the Ropes

https://www.wsj.com/finance/investing/how-wall-street-sussed-out-that-situational-awareness-was-o...
1•scrlk•11m ago•1 comments

Take-home pay calculator with real county/city tax data

https://gross.money/
1•greenthumbdrew•11m ago•0 comments

Photoshop: Adding Features You Don't Need Since 1990

https://myadventuresasanillustrator.substack.com/p/photoshop-adding-features-you-dont
1•pavel_lishin•12m ago•0 comments

Screwworm Infections Get Worse, Government Unleashing Drone Army to Surveil Them

https://www.techdirt.com/2026/08/17/screwworm-infections-get-worse-government-unleashing-drone-ar...
1•hn_acker•16m ago•1 comments

You Trust 1000 Strangers Every Time You Deploy

https://daylight.ai/blog/you-trust-1000-strangers-every-time-you-deploy
1•aviramha•16m ago•0 comments

Fyrox Game Engine now supports wgpu

https://github.com/FyroxEngine/Fyrox/pull/927
1•linggen•20m ago•0 comments

NoWreck v0.4.0

https://github.com/AstralXVoid/NoWreck/
1•AstralXVoid•20m ago•0 comments

Can Haskell Become a Great Language for Data Science?

https://www.youtube.com/watch?v=WpDVrUdbT2o
1•linggen•20m ago•0 comments

Reducing target directory size on nightly

https://blog.rust-lang.org/inside-rust/2026/08/18/reducing-target-dir-size-on-nightly/
2•linggen•21m ago•0 comments

One Person State – portable personal AI system

https://embassy.svit.la/p/one-person-state
1•promen_svitla•22m ago•0 comments

Every software company will become a dev tools company

https://thenewstack.io/platform-engineering-ai-harness/
1•tonkkatonka•23m ago•0 comments

And then the men with guns tell you to do it anyway

https://shkspr.mobi/blog/2026/08/and-then-the-men-with-guns-tell-you-to-do-it-anyway/
2•_djo_•23m ago•0 comments

Copia Institute Again Asks Court to Fix Contradictory Media Advertising Ruling

https://www.techdirt.com/2026/08/17/another-california-court-has-now-broken-media-advertising-so-...
1•hn_acker•23m ago•1 comments

Gmail Verified Sender Program eligibility and policies

https://support.google.com/mail/answer/12467704?hl=en
3•ChrisArchitect•23m ago•2 comments

A 24-Year-Old Blew Up a $45B AI Fund

https://rubbishtalk.com/finance/how-a-24-year-old-blew-up-a-45-billion-ai-fund/
1•Mr_Kobayashi•24m ago•0 comments

Poetry Lovers' Page

https://www.poetryloverspage.com/
1•pablode•25m ago•0 comments

Paperless Cloud Backups

https://samsm.ch/paperless-cloud-backups/
1•speckx•26m ago•0 comments

Apple's Camera-Equipped AirPods See Them in Action

https://www.macrumors.com/2026/08/17/camera-equipped-airpods-macos-26-7/
2•_djo_•26m ago•0 comments

Ask HN: How did Openrouter appreciate from –$1.3B to $7B+ in just 82 days?

https://www.axios.com/2026/08/17/stripe-openrouter-paypal
2•gulmothrowaway•26m ago•1 comments

If You Have Users, You Have to Market Your Programming Language

https://c3-lang.org/blog/you_have_to_market_your_programming_language/
1•kugurerdem•28m ago•0 comments