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

'Coltrane' Review: Sound and Spirit

https://www.wsj.com/arts-culture/books/coltrane-review-sound-and-spirit-b2417282
1•Thevet•1m ago•0 comments

The technology people call science fiction is here

https://github.com/KnowledgeeKZA3224/scqos-reference-implementation/blob/main/docs/THE_TECHNOLOGY...
1•Knowledgee_KZA•4m ago•0 comments

Datasets for Large Language Models: A Comprehensive Survey

https://arxiv.org/abs/2402.18041
1•Anon84•5m ago•0 comments

Revolut gave away customers' data

https://www.internationalcyberdigest.com/revolut-gave-away-customers-data/
1•taubek•7m ago•0 comments

Fx can now use a frontier model, then delegate to cheaper models to implement

https://twitter.com/fazxes/status/2098800924776903047
1•wslh•7m ago•0 comments

Vibe Coding Is the New Bootstrap

https://sampleminer.com/blog/vibe-coding-is-the-new-bootstrap/
1•xdotcommer•8m ago•1 comments

Adios Create – Landing page builder

https://www.adios.dev/create
1•clovis818•9m ago•0 comments

The U.N. Backs a New World Map Showing Africa in Its True Relative Size

https://www.npr.org/2026/09/04/nx-s1-5958611/africa-world-map-un-vote
2•karakoram•11m ago•0 comments

Csvcomp – Zero-dependency Python CSV diff utility

https://github.com/prasad-a-abhishek/csvcomp
1•prasadaabhishek•13m ago•0 comments

Namecheap Hosting Is Down

1•wolfgangbabad•16m ago•0 comments

WebSocket is a legacy API (2016)

https://github.com/whatwg/html/issues/2177
1•htunnicliff•16m ago•1 comments

NextJS but in Rust

https://nextrs.hirschi.dev/docs/getting-started
1•ashirsc•18m ago•0 comments

Claude of Tanks

https://github.com/Kevin-Liu-01/Claude-of-Tanks
1•tiredpanda•21m ago•0 comments

Comment: Feeling Sad about AI

https://simonwillison.net/2026/Sep/11/feeling-sad-about-ai/
1•abdelhousni•22m ago•0 comments

Spanish Island Wants to Ditch Drunk British Tourists for Rich American Ones

https://www.wsj.com/world/europe/this-spanish-island-wants-to-ditch-drunk-british-tourists-for-ri...
2•RestlessMind•23m ago•0 comments

Diablo V

https://diablo5.blizzard.com/en-us
1•meerita•23m ago•0 comments

EU CYBER RESILIENCE ACT forces manufacturers to disclose exploited vulnerabilit

https://digital-strategy.ec.europa.eu/en/policies/cra-reporting
3•drungli•26m ago•0 comments

Nvidia in talks to invest in Anthropic's mega IPO

https://www.reuters.com/legal/transactional/nvidia-talks-invest-anthropics-mega-ipo-sources-say-2...
1•cwwc•26m ago•0 comments

Teaching Novice Computing and Programming in the Agentic AI Era [pdf]

https://cs.brown.edu/people/sk/Publications/Papers/Published/fkl-teach-nov-agentic-ai-era/paper.pdf
2•azhenley•28m ago•0 comments

Free Agent – Amp

https://ampcode.com/news/free-agent
3•literallyroy•30m ago•0 comments

The Future of Blender [video]

https://www.youtube.com/watch?v=pTHmtHXwVKY
1•stephdin•30m ago•0 comments

Jeff Park: Lets slow down but not before we IPO not before we dump on retail

https://twitter.com/dgt10011/status/2098815095497253093
2•donsupreme•31m ago•0 comments

Our Eukaryotic Moment

https://contraptions.venkateshrao.com/p/our-eukaryotic-moment
1•brettcvz•36m ago•0 comments

Show HN: Vibe Logic Programming Language

https://cosmos-language-lab-0819.asd-user56.chatgpt.site/
1•mccosmos•36m ago•0 comments

Domain-Specific Hallucination Detection in Large Language Models

https://arxiv.org/abs/2609.11878
1•Betelbuddy•37m ago•0 comments

The Machine That Says No: 1-Bit Music on the ZX Spectrum [video]

https://www.youtube.com/watch?v=ZFL1ad90M2k
1•ofrzeta•39m ago•0 comments

ChiPass Release 2026.09.0

https://codeberg.org/ChiPass/ChiPass/releases/tag/v2026.09.0
1•birdculture•40m ago•0 comments

atx, the true structured text format (2002)

http://www.aaronsw.com/2002/atx/intro.html
1•theanonymousone•40m ago•0 comments

Sensetime Posts First Profit Since Listing as AI Revenue Rises

https://technode.global/2026/08/27/sensetime-h1-2026-first-profit-generative-ai-revenue/
1•drungli•41m ago•0 comments

Aaron Swartz and atx: the spec writer open source lost

https://dev.profullstack.com/~anthony/blog/121-post.html
2•theanonymousone•42m ago•0 comments