frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Package Quarantine and Urgent Release Protocol (Pqurp)

https://github.com/melbahja/draft-pqurp/blob/main/spec.md
1•dev0x0•1m ago•0 comments

Autoregressive next token prediction and KV Cache in transformers

https://medium.com/advanced-deep-learning/autoregressive-next-token-prediction-kv-cache-in-transf...
1•coarchitect•2m ago•0 comments

Don't Outsource the Learning to AI

https://twitter.com/addyosmani/status/2056078124346228860
1•ayoisaiah•4m ago•0 comments

Skilled – a CLI and TUI to inspect skill usage by your coding agents

https://github.com/av/skilled/releases/tag/v0.3.1
1•everlier•11m ago•1 comments

The Four Horsemen of the LLM Apocalypse

https://anarc.at/blog/2026-05-16-four-horsemen/
1•edward•11m ago•0 comments

Quit: A Human-in-the-Loop Platform for AI Research Automation

https://github.com/Mr-XcHan/QUIT
1•isxinchen•14m ago•0 comments

Fwd: [multicians] Peter Neumann has died

https://lwn.net/ml/all/CAEoi9W7rpLzdJzYJ3-F0KVJo-wQXa7UawUYtUoUUYy36m5e_3Q@mail.gmail.com/
2•Tomte•15m ago•0 comments

Kubernetes memory requests don't do what you think (until you enable MemoryQoS)

https://roszigit.com/en/blog/kubernetes-memory-request-limit
2•lkanwoqwp•16m ago•0 comments

Once Upon a Time in (New) Math

https://ssmcis-columbia.github.io/
2•he11ow•18m ago•0 comments

Show HN: A Pure-Python Computer Vision Library That's Fast and Minimal

https://github.com/abhiTronix/vidgear
1•abhiTronix•19m ago•0 comments

Use your Grok subscription in Hermes agent

https://x.ai/news/grok-hermes
1•sheepscreek•19m ago•0 comments

Vladislav Surkov

https://en.wikipedia.org/wiki/Vladislav_Surkov
1•James72689•23m ago•0 comments

Longtime Leading AMD Linux GPU Driver Developer Now Working for Valve

https://www.phoronix.com/news/AMD-Marek-Joins-Valve
3•Bender•24m ago•0 comments

New UFO files offer no answers–but something is happening in the skies

https://www.popsci.com/science/new-ufo-files-offer-no-answers-but-something-is-happening-in-the-s...
2•evo_9•30m ago•1 comments

VoIP Brings Back Old-Fashioned Pay Phones to Rural Vermont

https://spectrum.ieee.org/payphone-voip
2•bookofjoe•30m ago•0 comments

Paul Erdos

https://en.wikipedia.org/wiki/Paul_Erd%C5%91s
2•cemsakarya•30m ago•0 comments

The 27-tonne Giant Dinosaur Discovered in Thailand

https://www.discoverwildlife.com/dinosaurs/nagatitan-chaiyaphumensis-thailand
1•yusufaytas•32m ago•0 comments

WHO warns nicotine pouch brands targeting youth as sales surge

https://www.who.int/news/item/15-05-2026-who-warns-nicotine-pouch-brands-targeting-youth-as-sales...
2•geox•34m ago•0 comments

I, Dota 4 by Blurpi [video]

https://www.youtube.com/watch?v=pnqkN8fOWQk
1•ThoAppelsin•35m ago•0 comments

Mitigating Ongoing Supply Chain Attacks

https://hawksley.dev/blog/supply-chain-attacks/
2•ethanhawksley•38m ago•0 comments

Eric Schmidt booed at University of Arizona after praising AI

https://bsky.app/profile/404media.co/post/3mm2ivguvq22x
16•poisonfountain•38m ago•7 comments

The mistake of conflating intelligence and power

https://www.dwarkesh.com/p/the-mistake-of-conflating-intelligence
1•crescit_eundo•40m ago•1 comments

The Long History of the Figurative 'Literally' (2023)

https://www.mentalfloss.com/language/words/famous-writers-used-literally-figuratively
1•theanonymousone•42m ago•0 comments

Microsoft warns of Exchange zero-day flaw exploited in attacks

https://www.bleepingcomputer.com/news/microsoft/microsoft-warns-of-exchange-zero-day-flaw-exploit...
4•billybuckwheat•42m ago•0 comments

Enabling Resizable Bar on RTX 3080 Vbios via GitHub

https://github.com/danindiana/rtx3080-rebar-vbios/tree/master
1•linux_lorax•43m ago•0 comments

Smartmedia Card Spec Opened, available free (2000)

https://www.edn.com/smartmedia-card-interface-spec-opened-available-for-free/#google_vignette
2•brudgers•46m ago•1 comments

Growing Neural Cellular Automata

https://distill.pub/2020/growing-ca/
4•pulkitsh1234•48m ago•0 comments

Bun Audit: Add UB-exorcism audit workspace and executive guide

https://github.com/oven-sh/bun/pull/30903
1•gmays•50m ago•0 comments

Show HN: GPT-2 inference in pure C#, 0 bytes allocated per token

https://github.com/DevOnBike/Overfit
1•dev-on-bike•52m ago•0 comments

Ex150nosauce+ACV-6: new all-time low.. by 1lb

https://www.exfatloss.com/p/ex150nosauceacv-6-new-all-time-low
1•paulpauper•53m ago•0 comments