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

Playing Original Xbox Game Discs on a PC. Real Backward Compatibility

https://gdox.korze.org/wtf/
1•korze•57s ago•1 comments

Tell HN: Google search's date filters are unfunctional

1•YesBox•2m ago•0 comments

Ls-guard: generate and audit Postgres/Supabase RLS from a spec

https://github.com/greyrow/rls-guard
1•greyrow•4m ago•0 comments

Show HN: DSCode – Coding Agent Powered by DeepSeek

https://dscode.ai/
1•qwikhost•4m ago•0 comments

Single-file Ada 83 LLVM compiler

https://github.com/AdaDoom3/Ada83/tree/main
1•roger23•5m ago•0 comments

Fidelity Is Not Safety: Compressed LLMs Pass Quality Guards yet Invent

https://arxiv.org/abs/2607.28196
1•sbulaev•5m ago•0 comments

A few simple tricks for building chatbots with nice UX

https://christopherkrapu.com/blog/2026/simple-things-ai-engineering/
1•ckrapu•8m ago•0 comments

What If We Can Never Trust A.I.?

https://www.newyorker.com/culture/open-questions/what-if-we-can-never-trust-ai
1•replatformradar•8m ago•0 comments

"Bettering Myself" by Ottessa Moshfegh

https://electricliterature.com/bettering-myself-ottessa-moshfegh/
2•js2•9m ago•0 comments

Reaping the Whirlwind – Inside the Potomac River Midair Collision

https://admiralcloudberg.medium.com/reaping-the-whirlwind-inside-the-potomac-river-midair-collisi...
2•sklargh•13m ago•0 comments

Libadwaita: Splitting GTK and Design Language

https://tesk.page/2024/06/03/libadwaita-splitting-gtk-and-design-language/
1•mariuz•15m ago•0 comments

Fuse Programming Language

https://fuselang.org
1•the_unproven•15m ago•0 comments

Archaeologists Find Ancient Glyphs in the Amazon

https://www.nytimes.com/2026/07/31/world/americas/amazon-archaeology-geoglyphs.html
1•wglb•16m ago•0 comments

The Age of Technology Companies

https://shxxxjin.substack.com/p/the-age-of-technology-companies
1•brainer•22m ago•0 comments

docs: Add AI Section to CONTRIBUTING.md

https://github.com/thelounge/thelounge/pull/5130/files
1•MaxLeiter•23m ago•0 comments

LLMs Can Infer Political Alignment from Online Conversations

https://arxiv.org/abs/2603.11253
1•Anon84•23m ago•0 comments

Technical Deep Dive into the Entropy Issue

https://blog.coinkite.com/entropy-technical-backgrounder/
1•janandonly•23m ago•1 comments

Official ModRetro M64 Deep Dive: Console, Controller, Games [video]

https://www.youtube.com/watch?v=9gOJUEcKYRk
1•nomilk•24m ago•1 comments

Open Hardware and Free Software: Teufel Mynd, a Case Study

https://fsfe.org/news/2026/news-20260629-01.html
1•smartmic•28m ago•1 comments

Drones offer alternative to balloons for weather research

https://www.theguardian.com/news/2026/jul/31/weatherwatch-drone-base-station-offers-alternative-w...
1•arnejenssen•28m ago•0 comments

Fetch Needs Error Codes

http://www.jasnell.me/posts/fetch-needs-error-codes
1•meysamazad•28m ago•0 comments

Reviewing finished tasks from last week in org-agenda and Emacs

https://ashishpanigrahi.com/blog/done-items-org-agenda/
1•meysamazad•30m ago•0 comments

List of Style Guides

https://en.wikipedia.org/wiki/List_of_style_guides
1•dredmorbius•30m ago•1 comments

Show HN: Rad – A New Relational Database

https://www.radengine.dev/
1•Southclaws•36m ago•0 comments

A Scriptable 3D Graph Visualization

https://verticesandedges.net/?nburl=./examples/Cube.ipynb
1•countgraph•39m ago•0 comments

Enterprise cloud infrastructure uptake shows no sign of slowing

https://www.theregister.com/off-prem/2026/08/01/enterprise-cloud-infrastructure-uptake-shows-no-s...
2•magoghm•41m ago•0 comments

How to Prompt Any LLM?

https://blog.sparsh.dev/how-to-prompt-llms/
1•sparshrestha•42m ago•2 comments

BitChat: When the government bans the app, but not the network

https://ownyourdatamp.substack.com/p/bitchat-when-the-government-bans
3•marcoparisi•43m ago•1 comments

What is distributed Key Generation (DKG)?

https://stoffelmpc.com/stoffel-blog/what-is-distributed-key-generation-(dkg)
1•badcryptobitch•45m ago•0 comments

Show HN: WordJS – Open-source CMS where plugins run in OS sandboxes

https://github.com/jaimemartinez/wordjs
1•jaimedmartinezh•49m ago•0 comments