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

Show HN: Write SaaS apps where users control where their data is stored

https://github.com/wolfoo2931/linkedrecords/
1•WolfOliver•5m ago•0 comments

Disney+ Is Down

https://mashable.com/tech/disney-plus-down-outage
2•01-_-•6m ago•0 comments

I Replaced My Custom Next.js Portfolio with a Markdown First Site Engine

https://muhammadhaseeb.me/blog/why-koji
1•iamhaseeb•7m ago•0 comments

Contributor Poker and Zig's AI Ban

https://kristoff.it/blog/contributor-poker-and-ai/
1•birdculture•11m ago•0 comments

It looks like Elon Musk has a Giganormous tax bill coming

https://bsky.app/profile/bgrahamdisciple.bsky.social/post/3mokv2qdksc2m
1•doener•15m ago•1 comments

Google Is Using Nvidia's Playbook to Build a Rival AI Chip Business

https://www.wsj.com/tech/ai/google-is-using-nvidias-playbook-to-build-a-rival-ai-chip-business-1e...
1•doener•21m ago•0 comments

The Invisible Force of Brand Awareness

https://sofiamb.substack.com/p/the-invisible-force-of-brand-awareness
1•MelloS•21m ago•0 comments

Tirith – Detect terminal injection, homograph, and pipe-to-shell attacks

https://tirith.sh/
1•d3Xt3r•24m ago•0 comments

Building Reliable Agentic AI Systems

https://martinfowler.com/articles/reliable-llm-bayer.html
1•Garbage•29m ago•0 comments

Ordered Key Sharding in DynamoDB

https://death.andgravity.com/albumtitle
1•genericlemon24•31m ago•0 comments

Bernie Sanders unveils $7T plan to give Americans control of AI industry

https://arstechnica.com/tech-policy/2026/06/bernie-sanders-unveils-7-trillion-plan-to-give-americ...
3•asymmetric•33m ago•1 comments

Microsoft discovers new lightweight backdoor that steals cryptocurrency

https://arstechnica.com/security/2026/06/microsoft-spots-new-self-propagating-malware-for-stealin...
1•joozio•34m ago•0 comments

Show HN: Appaca – AI Workspace for Operators

https://www.appaca.ai/index.html
1•susros•42m ago•0 comments

Someone Built a Kleopatra Alternative for PGP

https://github.com/developaaah/pgp-manager
1•special_unicorn•49m ago•0 comments

Claude Code and Codex as one pipeline

https://www.unsiloed.ai/blog/guides/claude-code-codex-one-pipeline
1•ritzaco•50m ago•0 comments

Ask HN: Is Google's AI Mode and AI summaries now gone for everyone in EU?

2•consumer451•53m ago•1 comments

Roar (1981 Film)

https://en.wikipedia.org/wiki/Roar_(film)
1•vismit2000•53m ago•0 comments

Microsoft discovers new lightweight backdoor that steals cryptocurrency

https://www.techsentiments.com/article/2026/06/18/microsoft-discovers-new-lightweight-backdoor-th...
1•rajsuper123•56m ago•0 comments

Ask HN: Please recommend sci-fi books similar to "children of time" or "anathem"

1•rishabhpoddar•56m ago•0 comments

Every independent nation should work on three things

1•manishtiwari09•57m ago•0 comments

Refund: A farce in one act by Frigyes Karinthy

http://rafiq-lis.blogspot.com/2013/02/the-refund-hilarious-literary-play.html
1•rramadass•57m ago•1 comments

My suitcase robot gets high off a real gas sensor wired into the LLM sampler

https://old.reddit.com/r/LocalLLaMA/comments/1u9a17y/my_suitcase_robot_gets_high_now_off_a_real_gas/
1•thunderbong•1h ago•0 comments

Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

https://www.jvm-weekly.com/p/project-valhalla-explained-how-a
9•philonoist•1h ago•2 comments

Computer Chronicles

https://archive.org/details/computerchronicles
1•modinfo•1h ago•0 comments

Understanding Geometric Algebra for Electromagnetic Theory

https://ieeexplore.ieee.org/document/6474507
2•teleforce•1h ago•0 comments

Future of Software Engineering (2003)

https://web.archive.org/web/20151020012340/http://discuss.fogcreek.com/joelonsoftware1/default.as...
1•tosh•1h ago•0 comments

The Lonely Work of Moderating Hacker News (2019)

https://www.newyorker.com/news/letter-from-silicon-valley/the-lonely-work-of-moderating-hacker-news
3•andsoitis•1h ago•0 comments

GLM 5.2 vs. Opus

https://techstackups.com/comparisons/glm-5.2-vs-opus/
3•sixhobbits•1h ago•1 comments

Climate change: the CO2 emitter you may not know about (2018)

https://www.bbc.com/news/science-environment-46455844
3•downbad_•1h ago•0 comments

Mark Warren's favorite novels about a child's immersion into wilderness

https://bookdna.com/best-books/childs-immersion-into-wilderness
1•bwb•1h ago•0 comments