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

Who Shuts Down the Internet the Most?

https://pulse.internetsociety.org/en/shutdowns/
1•Bender•1m ago•0 comments

White House accelerates plans for AI model standards

https://www.ft.com/content/0bb7e2f9-007b-4577-9c4a-858948ee969a
1•OutOfHere•1m ago•0 comments

Carson Block: If you thought the global financial crisis was bad

https://www.economist.com/by-invitation/2026/06/28/if-you-thought-the-global-financial-crisis-was...
1•burntcaramel•2m ago•0 comments

Circle of Empathy

https://video.cirquedusoleil.com/originals/cirque-du-sound/season-1/ep5
1•andsoitis•3m ago•0 comments

Your AI lover will change you

https://www.newyorker.com/culture/the-weekend-essay/your-ai-lover-will-change-you
1•andsoitis•4m ago•0 comments

Arena, the AI leaderboard everyone uses, is now a $100M business

https://techcrunch.com/2026/06/29/arena-the-ai-leaderboard-everyone-uses-is-now-a-100m-business/
2•doppp•12m ago•0 comments

Ask HN: What things might help me to become inference engineer?

2•chalshik•14m ago•0 comments

Apple 'Hide My Email' Vulnerability Reveals Peoples' Real Email Addresses

https://www.404media.co/apple-hide-my-email-vulnerability-reveals-peoples-real-email-addresses/
2•phyzome•18m ago•0 comments

Show HN: One Page Life Calendar

https://beta.actions.life
1•eltonlin•19m ago•0 comments

Egg Libor Was Also Manipulated

https://www.bloomberg.com/opinion/newsletters/2026-07-01/egg-libor-was-also-manipulated
1•greyface-•24m ago•0 comments

The Graduate-School Dropout Toppling China's Academic Stars

https://www.wsj.com/science/the-graduate-school-dropout-toppling-chinas-academic-stars-3c1e5d86
1•petethomas•26m ago•0 comments

UK-US trade deal will lead to more than 200k avoidable deaths

https://www.theguardian.com/society/2026/jul/01/us-uk-drug-deal-could-result-in-229000-excess-dea...
1•secretslol•30m ago•0 comments

Stashing data in WOFF2 color glyphs to get free Brotli decompression via Canvas

https://github.com/EtherDream/brpack/
1•etherdream•30m ago•0 comments

MacBasic (1985)

https://www.folklore.org/MacBasic.html
1•andsoitis•37m ago•0 comments

Ask HN: noticed how HN performs sentiment-analysis on everything posted here?

1•bridgettegraham•40m ago•6 comments

Nvidia Through a Crypto Miner's Eyes

https://vincentping.com/en/nvidia-through-miner-eyes
1•vincentping•41m ago•1 comments

Check Out My Website

https://topic-chat-hub--seattlem112.replit.app/
1•computerwonder•41m ago•0 comments

Kids learn to bully from adults' threats, manipulation and criticism

https://theconversation.com/kids-learn-to-bully-from-adults-threats-manipulation-and-criticism-a-...
5•1659447091•46m ago•1 comments

Show HN: Rust Backed Fast Dataloader

https://github.com/midhunharikumar/ferroload
1•midhunharikumar•49m ago•1 comments

Meta to sell excess compute, like SpaceX

https://techcrunch.com/2026/07/01/meta-like-spacex-looks-to-turn-excess-ai-compute-into-cash/
2•noashavit•49m ago•2 comments

Databricks LTAP Explained

https://sys0.substack.com/p/databricks-ltap-explained-turning
1•shenli3514•50m ago•0 comments

Konsistent: Enforce consistent code for agents and humans

https://vercel.com/changelog/enforce-consistent-code-for-agents-and-humans-with-konsistent
2•handfuloflight•50m ago•0 comments

Show HN: Meow – The 4th and final JavaScript runtime and toolchain

https://meow.style
11•ccheshirecat•54m ago•5 comments

SpaceX Hangover Spreads

https://www.ft.com/content/6a13a108-ef3e-41b5-aaba-7f61eff61ae0
2•1vuio0pswjnm7•56m ago•1 comments

Stevie: Vim Predecessor ("ST editor for vi enthusiasts")

https://en.wikipedia.org/wiki/Stevie_(text_editor)
1•erelong•58m ago•0 comments

Why is Apple asking me to pay more for Big Tech's AI obsession?

https://www.theverge.com/report/958678/apple-consumer-price-increase-ai-big-tech
3•1vuio0pswjnm7•59m ago•2 comments

Early look at Anthropic's Claude Science app for researchers

https://www.testingcatalog.com/early-look-at-anthropics-claude-science-app-for-researchers/
1•willmarch•1h ago•0 comments

Fable Is Back: This Safeguard Has Some AI in It

https://www.thealgorithmicbridge.com/p/fable-is-back-this-safeguard-has
1•swolpers•1h ago•0 comments

Making LLMs Better at Creative Writing Using Entropy

https://www.countbayesie.com/blog/2026/7/1/making-llms-better-at-creative-writing-using-entropy
2•roadside_picnic•1h ago•1 comments

Programming Quotes

https://gist.github.com/Potherca/5ffd57393a85553ab55b
1•sillysaurusx•1h ago•1 comments