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

Flash Drive Has Every File

https://www.youtube.com/watch?v=w6rkhvdAqHU
1•SpyCoder77•32s ago•0 comments

Why does Deno Deploy block /wp-content?

https://deno.com/wp-content
1•tisizi•33s ago•1 comments

I'm Rich

https://www.guidavid.com/writing/im-rich
1•gdss•4m ago•0 comments

Claude for Financial Services

https://notebooklm.google.com/notebook/16f00c29-20fe-42fe-b77d-cfc3b02b879b/artifact/7e5a9568-45f...
1•gilthor•5m ago•0 comments

The terrific technical debt of Arabic typography rendering: an interactive tour

https://lr0.org/blog/p/arabic/
2•lr0•9m ago•0 comments

Agent-gate – fail-closed agent gate and tamper-evident receipts as an MCP server

https://github.com/Jott2121/agent-gate
1•jott2121•12m ago•0 comments

Exposing the Solid State Donut Battery. It's over [video]

https://www.youtube.com/watch?v=j5oyVNjrUPI
1•ot•13m ago•0 comments

Ads in New York must now label AI-generated 'synthetic performers'

https://apnews.com/article/new-york-ai-law-hochul-synthetic-performers-e433625bfb61c8abeab0d61986...
1•1659447091•17m ago•0 comments

An entrance animation stranded my dashboard on a black screen

https://stengineer.dev/lab/walking-into-hour-four
1•lookingforsome•17m ago•0 comments

OpenAI C2PA Policy

https://help.openai.com/en/articles/8912793-c2pa-and-synthid-in-openai-generated-images
2•sarkarghya•18m ago•0 comments

Building Hollywood Motion Capture from Scratch [video]

https://www.youtube.com/watch?v=kYVqL_DqBis
2•radeeyate•19m ago•0 comments

Nontrailing separators do not spark joy

https://buttondown.com/hillelwayne/archive/nontrailing-separators-do-not-spark-joy/
2•birdculture•20m ago•0 comments

702 Ultimatum: Warrant Requirement or Bust

https://www.eff.org/deeplinks/2026/06/702-ultimatum-warrant-requirement-or-bust
2•kevinwang•22m ago•0 comments

Loop-Harness

https://github.com/lSAAGl/loop-harness
2•LordIsBack•25m ago•0 comments

Show HN: Obsidian Image Upload Toolkit – upload images to 10 cloud providers

https://github.com/addozhang/obsidian-image-upload-toolkit
2•addozhang•28m ago•0 comments

Recovering attention during heavy study efforts

https://socketstudy.com/sparks/recovering-attention/
2•wingrove•34m ago•0 comments

Nexus Q Revival

https://mikevoyt.github.io/nexusq-revival/
2•tmp10423288442•34m ago•0 comments

Closing the Loop: One Impressive AI Coding Agent Session for Y-Combinator

https://vmysla.substack.com/p/closing-the-loop-one-impressive-ai
2•vmysla•35m ago•0 comments

A smarter approach to designing metamaterials

https://engineering.berkeley.edu/news/2025/07/a-smarter-approach-to-designing-metamaterials/
3•airstrike•36m ago•0 comments

Beneath The Enshittification, Something Amazing Is Growing

https://www.techdirt.com/2026/06/10/beneath-the-enshittification-something-amazing-is-growing/
4•hn_acker•37m ago•0 comments

Unix GC Remastered

https://mohandacherir.github.io/Qdiv7/posts/unix_new_gc/
3•mananaysiempre•38m ago•0 comments

LaserWriter Seeds

https://inventingthefuture.ghost.io/laserwriter-seeds/
3•frizlab•39m ago•0 comments

A Way to Challenge the Groupthink of Scholarly Journals

https://www.wsj.com/opinion/a-way-to-challenge-the-groupthink-of-scholarly-journals-8e59b215
2•noworld•46m ago•1 comments

Plinko Input – type a code by dropping balls

https://plinkoinput.com/
2•felixguilherme•56m ago•0 comments

The theory taking the rich by storm: China funds data center haters

https://text.npr.org/nx-s1-5844328
5•1659447091•58m ago•0 comments

Show HN: I let an AI C-suite run my company – starter kit from the inside

https://thepromptnova.gumroad.com/l/bfixc
3•clarezoe•1h ago•0 comments

Show HN: Llmbuffer – Python library for cache-optimized LLM conversation history

https://github.com/scottpurdy/llmbuffer
4•scottmp10•1h ago•0 comments

Show HN: Vatnode – EU VAT validation REST API with national registry fallback

https://vatnode.dev
4•rogulia•1h ago•0 comments

/dmg – a Claude Code skill for persistent memory and session sync

https://github.com/responsiblparty/claude-dmg-skill
4•responsiblparty•1h ago•1 comments

Nuts – pip/NPM for Java with first-class workspaces and JDK provisioning (9y+)

https://github.com/thevpc/nuts
3•thevpc•1h ago•0 comments