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

You Are an 'Avatar in a VR Game,' Scientist Claims

https://www.popularmechanics.com/science/a71445608/space-time-illusion-consciousness/
1•XzetaU8•33s ago•0 comments

AI and the Psychology of Cognitive Surrender

https://www.psychologytoday.com/us/blog/the-digital-self/202606/ai-and-the-psychology-of-cognitiv...
2•xenophonf•3m ago•0 comments

Raytracing Geometries in 3D Rendering

https://andeplane.github.io/Raytracing/
1•kvakkefly•3m ago•1 comments

Why GPTHuman AI Is the Best AI Humanizer?

https://gpthuman.ai/
1•karl192001•4m ago•0 comments

Ask HN: Playlist – Hit the Road

1•systemkwiat•6m ago•0 comments

Scientists Create Tiny Chip That Uses Light Instead of Electricity

https://scitechdaily.com/scientists-create-tiny-chip-that-uses-light-instead-of-electricity-to-pr...
1•01-_-•8m ago•0 comments

Zamicus+|+Dang.ai

https://dang.ai/tool/ai-marketing-intelligence-zamicus-com
1•VickyK09•9m ago•0 comments

The AI Question That No AI Person Asks [video]

https://www.youtube.com/watch?v=o9Vbvp4awQU
2•mantesso•10m ago•0 comments

PlayStation Architecture

https://www.copetti.org/writings/consoles/playstation/
2•gregsadetsky•16m ago•0 comments

Open Source Aviation Maps

https://tech.marksblogg.com/aviation-maps.html
2•marklit•18m ago•0 comments

Illegal live TV streaming in Germany grows 33% since 2022, to €2.4B loss in 2025

https://vau.net/pressemeldungen/study-reveals-annual-losses-of-e2-4-billion-from-illegal-tv-strea...
2•giuliomagnifico•19m ago•0 comments

Google must let publishers opt out of AI Search features, rules UK

https://www.theverge.com/tech/942302/google-search-ai-overviews-uk-cma-publisher-opt-out
1•SockThief•20m ago•0 comments

Exploring geospatial link between soils and national intelligence quotient

https://www.nature.com/articles/s41598-025-22539-5
1•geox•25m ago•0 comments

What we learned mapping a year's worth of AI-enabled cyber threats

https://www.anthropic.com/news/AI-enabled-cyber-threats-mitre-attack
1•surprisetalk•26m ago•0 comments

JL Collins goes global, and why that feels familiar

https://www.thehappysaver.com/blog/jl-collins-goes-global-and-why-that-feels-familiar
1•teleforce•26m ago•0 comments

You won't be talking to AI in natural language for too long

https://www.elicited.blog/posts/you-wont-be-talking-to-ai-in-natural-language-for-too-long
2•justanotheratom•29m ago•1 comments

Oils – Reviewing Our NLnet Grants After 4 Years

https://oils.pub/blog/2026/06/grants.html
1•birdculture•30m ago•0 comments

Mathematicians issue warning as AI rapidly gains ground

https://www.science.org/content/article/mathematicians-issue-warning-ai-rapidly-gains-ground
2•pseudolus•35m ago•0 comments

Redis 8.8: New array data structure, rate limiter, performance improvements

https://redis.io/blog/announcing-redis-8-8/
1•ksec•36m ago•0 comments

The empty field that wasn't

https://lsc-pagepro.mydigitalpublication.com/publication/?i=865273
1•robinhouston•41m ago•2 comments

Japan declines to join movement to ban youth from social media

https://www.asahi.com/ajw/articles/16615541
6•BaudouinVH•44m ago•2 comments

A runtime verification pipeline that reduced hallucinations from 67% to 11%

https://www.crukx.dev/
2•Shafwan_safi•45m ago•0 comments

Gödel and Turing outlined the limits of AI

https://www.heise.de/en/blog/How-Goedel-and-Turing-outlined-the-limits-of-AI-11313804.html
1•bertman•47m ago•0 comments

Build 2026: WSL improvements and the new Containers CLI and APIs

https://build.microsoft.com/en-US/sessions/DEM346
5•pjmlp•48m ago•1 comments

Embedding Tailwind Design System in Obsidian

https://alessandrofarace.com/essay/how-to-embed-design-system-obsidian
1•A-F-V16•50m ago•0 comments

Show HN: Vivix – See inside JavaScript as it executes (open source)

https://vivix.dev/
2•hlude•50m ago•1 comments

UK lawmakers call on government to ditch Palantir NHS contract

https://www.theregister.com/software/2026/06/03/uk-lawmakers-call-on-government-to-ditch-palantir...
5•beardyw•52m ago•0 comments

Google Is Quietly Buying Code from Play Store Developers to Train AI

https://www.404media.co/google-is-quietly-buying-code-from-play-store-developers-to-train-ai/
2•beardyw•54m ago•1 comments

Show HN: A HTML Quine Made with Nix

https://emsh.cat/niccup/examples/quine/
1•embedding-shape•1h ago•0 comments

Metaprogramming for Madmen (2012)

https://fgiesen.wordpress.com/2012/04/08/metaprogramming-for-madmen/
1•tosh•1h ago•0 comments