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

Claude Cohen-Tannoudji (Physics Nobel Prize 1997) has died

https://www.lkb.fr/en/death-of-claude-cohen-tannoudji/
1•Qision•1m ago•0 comments

Malaysian PM Anwar Bans Civil Servants from Using Israel-Developed Mapping App

https://thediplomat.com/2026/10/malaysian-pm-anwar-bans-civil-servants-from-using-israel-develope...
1•thisislife2•2m ago•0 comments

Show HN: Jam – a platform where beginners can collaborate in music

https://github.com/hellojunchobo/Jam-music
1•john2ne•2m ago•0 comments

Connecting ESP-Mosaico Board over ESP-Now to Run Amplifier Models in Parallel

https://circuitdigest.com/news/connecting-esp-mosaico-boards-wirelessly-over-esp-now-to-run-multi...
1•arbayi•2m ago•0 comments

October Counterfeit Block: What Happened and Where Every Coin Went

https://getbtcz.com/news/2026-10-22-counterfeit-block-1860181-every-coin-traced/
2•ztextzksnarks•4m ago•0 comments

Farol: The anti-slop workspace for your agents

https://www.farol.build/
2•acfilho•5m ago•0 comments

What Could Go Wrong

https://techcrunch.com/2026/10/22/1password-launches-a-way-for-ai-agents-to-log-in-on-your-behalf...
1•mrc3llophane•8m ago•0 comments

Glyphh Ada: Decision model that learns from your past decisions, no transformer

https://glyphh.ai/blog/introducing-ada
1•glyphhai•9m ago•0 comments

The most important thing today is that Starlink and Starshield operations

https://twitter.com/zelenskyyua/status/2113990281322221932
1•doener•10m ago•0 comments

AI Assistance Reduces Persistence and Hurts Independent Performance

https://arxiv.org/abs/2604.04721
1•ingve•12m ago•0 comments

How AI Saved My Company From a 2-Year Litigation Nightmare

https://tylertringas.com/ai-legal/
1•karakoram•13m ago•0 comments

RFC 8949: STD 94: Concise Binary Object Representation (CBOR)

https://www.rfc-editor.org/info/rfc8949/
1•Bluestein•17m ago•0 comments

Not Invented Here

https://en.wikipedia.org/wiki/Not_invented_here
2•amelius•17m ago•1 comments

We are terminating Chris Degnan for unethical conduct involving Cognition

https://twitter.com/matanSF/status/2105335179502064038
1•ksec•17m ago•0 comments

UX Research for AI Products: The AI-Native Research Lifecycle

https://www.uxness.in/2026/10/ux-research-for-ai-products-ai-native-research-lifecycle.html
1•uxrabhi•18m ago•0 comments

All Abstractions Are the Same

https://t3.at/blog/everything-is-everything/
1•vismit2000•18m ago•1 comments

What the U.S. Is Doing in Venezuela

https://www.theatlantic.com/magazine/2026/12/trump-oil-venezuela-exploitation/689033/
2•_tk_•18m ago•0 comments

Google illegally cut down 250K trees in Finland for data center

https://nypost.com/2026/10/24/business/google-illegally-tore-down-250k-trees-for-finland-data-cen...
7•rustybolt•19m ago•2 comments

With recent eMudra case, learning Cryptography well is more important that

1•shoebilyas_hanz•19m ago•0 comments

Show HN: TenseMem – deterministic memory for AI agents

https://github.com/tensemem/tensemem
1•shubh-singh•20m ago•0 comments

BeNice Closing the Inference-Memory Gap of Looped Models with KV-Sharing

https://sandyresearch.github.io/benice/
1•simonpure•21m ago•0 comments

I created this because I wanted to

https://avanelsas.github.io/foggy-glasses/i-created-this-because-i-wanted-to/
2•vanelsas•21m ago•0 comments

Group in San Francisco graftng fruit-bearing branches onto street trees

https://twitter.com/JasonBassler1/status/2113745277416771830
4•bilsbie•21m ago•0 comments

Under a Cloud: How was slavery justified?

https://www.lrb.co.uk/the-paper/v48/n19/alexander-bevilacqua/under-a-cloud
2•Tomte•23m ago•0 comments

Show HN: Firefighter.sh – an insane solution to the current CVE apocalypse

https://firefighter.sh/
1•jjcm•27m ago•2 comments

Show HN: Visual Studio extension that shows decimal and hex in the debugger

https://github.com/JochenBaier/AlwaysHex
1•__builtin_trap•28m ago•0 comments

How Much Does Custom Software Development Cost in the UK?

https://www.bitechnology.co.uk/
1•itshimbilal•29m ago•0 comments

AegisKernel – Zero-Trust OS Syscall and Shell Defense for AI Agents

https://github.com/adikshatriyag-crypto/aegis-kernel
1•adityawebde•32m ago•0 comments

The Human Brain Owes Its Existence to a Prehistoric Pandemic

https://www.psychologytoday.com/us/blog/the-new-brain/202610/the-human-brain-owes-its-existence-t...
1•gmays•32m ago•0 comments

New Critical Television

https://openvault.wgbh.org/exhibits/new-critical-television
1•jruohonen•33m ago•0 comments