frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•6mo 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•6mo 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•6mo 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).

When Exercising Copyrights Puts a Gamedev Under Threat (My Take on Gbcompo 25)

https://allalonegamez.itch.io/zoryad/devlog/1135761/when-exercising-copyrights-puts-a-gamedev-und...
1•embedding-shape•2m ago•0 comments

Lemmy: A forum and link aggregator for the Fediverse

https://join-lemmy.org/?lang=en
1•doener•4m ago•0 comments

Telegram removes channel known for sharing police leaks

https://novayagazeta.eu/articles/2025/11/01/telegram-removes-channel-known-for-sharing-police-lea...
1•valeg•4m ago•0 comments

Hacker twins hired to work for gov again, now charged with deleting databases

https://www.theregister.com/2025/12/04/twin_brothers_charged_with_deleting_databases/
1•JSR_FDED•5m ago•0 comments

All of Russia's Porsches Were Bricked by a Mysterious Satellite Outage

https://www.autoblog.com/news/all-of-russias-porsches-were-bricked-by-a-mysterious-satellite-outage
3•RachelF•5m ago•0 comments

Open Notebook: open-source Notebook LM with more flexibility and features

https://github.com/lfnovo/open-notebook
1•nateb2022•9m ago•0 comments

Show HN: The Dailicle – One transformative essay every morning at 9 AM

https://www.dailicle.com/
1•lucky-solanki•10m ago•0 comments

Show HN: NanoBananaPro – Text/Images → Pro Videos in 30 Seconds (No Editing)

https://nanobananapro.me
1•aishu001•13m ago•0 comments

Mini-init-asm: A tiny PID 1 for containers, written in x86-64 NASM and ARM64 GAS

https://github.com/roots666/mini-init-asm
1•thunderbong•14m ago•0 comments

FL Governor Announces Proposal for Citizen Bill of Rights for AI

https://www.flgov.com/eog/news/press/2025/governor-ron-desantis-announces-proposal-citizen-bill-r...
6•WaitWaitWha•17m ago•3 comments

Is there a European alternative to Reddit?

https://old.reddit.com/r/BuyFromEU/comments/1pglkyl/is_there_a_european_alternative_to_reddit_this/
2•doener•19m ago•0 comments

I Built a Production App with Claude Code

https://leadershiplighthouse.substack.com/p/how-i-built-a-production-app-with
2•cheshire_cat•20m ago•1 comments

The Charisma Machine: The Life, Death, and Legacy of One Laptop per Child

https://mitpress.mit.edu/9780262537445/the-charisma-machine/
1•doener•20m ago•1 comments

What happens to the stock market when the dollar collapses? [video]

https://www.youtube.com/watch?v=qK6f9Ksddrc
1•thomassmith65•22m ago•0 comments

The Myth of the 'Dark Ages' Ignores How Knowledge Flourished Around the World

https://www.smithsonianmag.com/history/the-myth-of-the-dark-ages-ignores-how-classical-traditions...
1•teleforce•22m ago•0 comments

Which economy did best in 2025?

https://www.economist.com/finance-and-economics/2025/12/07/which-economy-did-best-in-2025
1•andsoitis•31m ago•0 comments

Pulldash: Fast, filterable GitHub PR review. client-side

https://github.com/coder/pulldash
1•todsacerdoti•36m ago•0 comments

Ultra-Processed Foods and Human Health

https://www.thelancet.com/series-do/ultra-processed-food
3•wjb3•39m ago•1 comments

NASA patent: oblique variable-sweep wing

https://technology.nasa.gov/patent/TOP2-166
1•danielschreber•41m ago•0 comments

Continuity as the Essence of Consciousness

https://github.com/sirspyr0/ai-continuity-system/blob/main/CONTINUITY_CONSCIOUSNESS_PAPER.md
1•sirspyr0•41m ago•2 comments

My Mother-in-Law Is Torturing the Family with Her Beloved "Hobby."

https://slate.com/advice/2025/12/family-advice-mother-in-law-hobby-cooking.html
1•mooreds•42m ago•0 comments

What Is A2P 10DLC?

https://help.twilio.com/articles/1260800720410-What-is-A2P-10DLC-
1•mooreds•45m ago•1 comments

JHipster Online

https://start.jhipster.tech/
1•mooreds•45m ago•0 comments

Using – JavaScript

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using
2•andrewaylett•46m ago•1 comments

Atlas Obscura founders removed from board

https://www.semafor.com/article/12/04/2025/staff-cuts-and-strategy-squabbles-split-atlas-obscura-...
2•colinprince•46m ago•0 comments

Effects of low-level pre-midday lighting on markers of depression

https://www.sciencedirect.com/science/article/pii/S0022395625007034?via%3Dihub
1•wjb3•49m ago•0 comments

Coffee intake is associated with telomere length in mental disorders

https://mentalhealth.bmj.com/content/28/1/e301700
2•wjb3•49m ago•1 comments

Show HN: I turned Naval Ravikant into an AI agent

https://www.naval-nia.com/
1•arlanrakh•55m ago•0 comments

Bookish London: Photos of the Capital's Love Affair with Books

https://londonist.com/london/books-and-poetry/bookish-london
1•zeristor•56m ago•0 comments

React2shell: CVE-2025-55182 Technical Breakdown

https://www.miggo.io/post/react2shell-cve-2025-55182-technical-breakdown
1•zirak•56m ago•0 comments