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

Symbolics.com – The First Domain Name Ever Registered on the Internet

https://www.symbolics.com/
1•simonpure•27s ago•0 comments

Legal AI, not a coding agent with scaffolding

https://lexifina.com/blog/legal-ai-not-a-coding-agent-with-scaffolding
1•alansaber•5m ago•0 comments

Is ChatGPT Down?

3•behindai•5m ago•2 comments

Information Awareness Office

https://en.wikipedia.org/wiki/Information_Awareness_Office
1•soupspaces•5m ago•0 comments

ChatGPT Is Down

https://chatgpt.com/
7•distrill•8m ago•4 comments

Why organizing knowledge in the age of AI sucks, and how I solve it

https://jordangreen.bearblog.dev/why-organizing-knowledge-in-the-age-of-ai-sucks-and-what-i-built/
1•enteigss•9m ago•0 comments

Show HN: Asciitopia – a library of animated ASCII art patterns

https://github.com/flawnn/asciitopia
1•flawn•10m ago•0 comments

Show HN: Self-hosted Minecraft multi-server panel for vanilla and modpacks

https://github.com/anefzaoui/minecraft-server-manager
1•ahmednefzaoui•12m ago•0 comments

House passes bill to make daylight saving time permanent

https://www.cbsnews.com/news/daylight-saving-time-permanent-house-vote/
1•m348e912•12m ago•4 comments

OpenAI and Anthropic warning about a future they're building at breakneck speed

https://www.businessinsider.com/openai-anthropic-warning-about-future-they-are-building-2026-6
2•falcor84•14m ago•0 comments

We Demand Perfect Machines yet Tolerate Human Carnage

https://www.noemamag.com/why-we-demand-perfect-machines-yet-tolerate-human-carnage/
3•mikelgan•15m ago•0 comments

Maincode launches Matilda, an AI assistant running on Australian infrastructure

https://blog.maincode.com/introducing-matildas-open-beta-australian-ai-built-for-trust/
1•huey77•15m ago•0 comments

A Framework for Frontier AI and the Dawning of a New Age

https://demishassabis.substack.com/p/a-framework-for-frontier-ai-and-the-dawning-of-a-new-age
2•wunderwuzzi23•20m ago•0 comments

Lenovo ThinkStation P3 Ultra SFF Gen 2 Review: Small Chassis, Surprising Power

https://www.storagereview.com/review/lenovo-thinkstation-p3-ultra-sff-gen-2-review-small-chassis-...
1•teleforce•20m ago•0 comments

PixelSat I Software Part 2: Attitude Determination and Control System

https://www.projectpixelorbital.com/software-2/
1•aadishv•24m ago•0 comments

US Congress takes next step to make daylight saving time permanent

https://www.bbc.com/news/articles/cz9l9venjd8o
2•xoxxala•29m ago•1 comments

Lawsuit claims Meta's layoff decisions were made by AI, not humans

https://arstechnica.com/tech-policy/2026/07/lawsuit-claims-metas-layoff-decisions-were-made-by-ai...
6•BeetleB•30m ago•4 comments

NeuralPGN – local-first chess repertoire trainer with FSRS (Tauri)

https://github.com/kfunezc204/neuralpgn
2•kfunezc204•32m ago•0 comments

FreeBSD 16 Retires the Last of Its GPL Code from Its Base System

https://www.phoronix.com/news/FreeBSD-16-Goes-GPL-Free
2•terminalbraid•32m ago•0 comments

What Is "Loop Engineering?"

https://newsletter.pragmaticengineer.com/p/what-is-loop-engineering
1•Khaine•35m ago•0 comments

The website Fable 5 built for my iOS App

https://www.xtraktr.com/
1•kiloloco•35m ago•0 comments

Git-absorb: Git commit –fixup, but automatic

https://github.com/tummychow/git-absorb
1•birdculture•36m ago•0 comments

The Center of Our Galaxy Is More Like a Raspberry Donut Than We Realized

https://www.sciencealert.com/scientists-find-the-first-true-sugar-ever-detected-in-interstellar-s...
2•gmays•36m ago•1 comments

The Future of American Power

https://carnegieendowment.org/projects/beyond-disruption/collections/the-future-of-american-power
1•luu•38m ago•0 comments

Building a Static Site with Pandoc

https://joeldare.com/building-a-static-site-with-pandoc
1•codazoda•40m ago•0 comments

ARDY: Autoregressive Diffusion for Human Motion Generation

https://research.nvidia.com/labs/sil/projects/ardy/
2•klaussilveira•43m ago•0 comments

LLM-as-a-Verifier: A General-Purpose Verification Framework

https://arxiv.org/abs/2607.05391
2•gmays•47m ago•0 comments

Plans for New Zealand's first AI datacentre spark concerns

https://www.theguardian.com/world/2026/jul/10/new-zealand-first-datacentre-concern-locals-makarew...
5•billybuckwheat•48m ago•0 comments

Japan begins standing up new Intel agency with input from allies

https://www.japantimes.co.jp/news/2026/07/13/japan/politics/japan-intelligence-agency/
3•keepamovin•53m ago•0 comments

The Luna-cy of getting Lock The Clock done

https://locktheclock.net/time/2026/07/the-luna-cy-of-getting-lock-the-clock-done/
2•toomuchtodo•57m ago•1 comments