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

Banks look to dump AI debt

https://www.semafor.com/article/11/26/2026/banks-look-to-dump-ai-debt
1•PLenz•35s ago•0 comments

Motion Design with CSS Anchors

https://blog.master.dev/motion-design-with-css-anchors/
1•ibobev•1m ago•0 comments

China car ban at the 'one yard line' in Congress

https://www.politico.com/news/2026/11/26/congress-china-cars-autos-ban-lame-duck-01183667
2•JumpCrisscross•1m ago•0 comments

Revolutionary Networks – Degrees of Separation

https://revolutionary-networks.org/correspondence-network/
2•gradus_ad•1m ago•0 comments

Show HN: Single Calendar – Sync multiple Google calendars

https://singlecalendar.com
2•tsergiu•2m ago•0 comments

Show HN: Resolving the black hole singularity with a pure-P(X) khronon bounce

https://cwtractors.com
2•ktractor123•5m ago•0 comments

Nvidia was right to bring back Jensen Huang, writes Sarah Guo

https://www.economist.com/by-invitation/2026/11/25/nvidia-was-right-to-bring-back-jensen-huang-wr...
3•andsoitis•10m ago•0 comments

Wild Market Swings Are Colliding with a Fed Bent on Taming Inflation

https://www.wsj.com/economy/central-banking/wild-market-swings-are-colliding-with-a-fed-bent-on-t...
3•madihaa•15m ago•0 comments

Conway's law just hit your software factory

https://www.robert-glaser.de/conways-law-just-hit-your-software-factory/
2•youngbrioche•18m ago•0 comments

Show HN: Décor does HTML widgets for the Mac (you know, like in the old days)

https://stgm.github.io/decor/
3•omsta•18m ago•0 comments

How the Trump admin determined Jensen Huang is not a national security threat

https://www.reuters.com/business/us-justice-department-did-not-open-probe-into-jensen-huang-befor...
2•toomanyrichies•19m ago•0 comments

Reverse engineered Samsung Gear VR controller

https://github.com/dennisonbertram/gearvr-controller
2•dennisonbuildss•19m ago•1 comments

The condensed Lean proof of RH and GRH: a reading [pdf]

https://nasqret.github.io/riemann-rev/writeup/handout.pdf
2•rossant•20m ago•0 comments

Show HN: Explore the 17M-line Lean proof of the Riemann Hypothesis

https://maic.me/alpoge/
2•Maicon•21m ago•0 comments

Signs of AI Writing, Backed by Data

https://www.pangram.com/fr/signs-of-ai-writing
1•paulpauper•22m ago•0 comments

Konjugate Joins the Official FMI Tools Directory

https://www.konjugate.com/2026/11/konjugate-joins-official-fmi-tools.html
1•zenin•22m ago•0 comments

Show HN: Play with VST/CLAP instruments and effects in the browser

https://vst.run/
1•mrmufungo•24m ago•0 comments

Enough with the Brussels Sprouts

https://www.theatlantic.com/ideas/2025/11/thanksgiving-food-vegetables-cabbage/685047/
2•paulpauper•24m ago•1 comments

AI #196: The Return

https://thezvi.substack.com/p/ai-196-the-return
1•paulpauper•25m ago•0 comments

Karpathy postulates 1B "cognitive core" models. I postulate 0B

1•kbr-•28m ago•1 comments

Show HN: Footprint – Visual electronics learning, encyclopedia, and part search

https://usefootprint.app/
1•mr-footprint•28m ago•0 comments

Can you please throw your agents at my paper?

https://wilsoniumite.com/2026/11/26/anthropic-and-or-openai-can-you-please-throw-your-agents-at-m...
1•Wilsoniumite•29m ago•0 comments

The Smallest Laptop. Tiny Violin Not Included

https://blog.edovia.com/en/screens-5-10-6-duo-laptop-mode
1•MBCook•31m ago•0 comments

Does Visual Studio Rot the Mind? (2005)

https://www.charlespetzold.com/etcetera/DoesVisualStudioRotTheMind.html?hl=en-US
3•glimshe•36m ago•1 comments

GoLand Intelligence Now Available in Cursor and VS Code

https://blog.jetbrains.com/go/2026/11/25/go-by-goland-public-preview/
1•Annprots•38m ago•0 comments

ShareMyTokens – Share AI API access on a token budget, without exposing your key

https://sharemytokens.com
1•ibrahimpelumi61•38m ago•0 comments

Wiping out the competition with better and free'er offerings

https://free-utils.com/compress-pdf
1•AndrewJesse•39m ago•0 comments

JADC2 and the Data Link Problem: Link 16, MADL and the Interoperability Gap

https://advancedprimitive.com/innovation/jadc2-data-links-primer/
1•yubblegum•41m ago•0 comments

Ka-table – a free React data grid with no paywalled features

https://github.com/komarovalexander/ka-table
1•sanrkom•42m ago•0 comments

The Worst New YouTube Sponsor – Fern YT

https://www.youtube.com/watch?v=wA2DRkzGfr4
2•UrbanNorminal•46m ago•1 comments