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

Show HN: Copperhead – Hardware as Fast as Software

https://copperhead.sh/blog/hardware-as-fast-as-software/
1•animeshchouhan•1m ago•0 comments

Micro-Fabrication with a Fiber Tip – A Low-Cost 3D Micro Printing Method [video]

https://www.youtube.com/watch?v=UvV2CH5il3Q
1•Matt-Hayes•2m ago•0 comments

Some Scientists Have 'Magic Hands' in the Lab. This A.I. Is Learning Why.

https://www.nytimes.com/2026/08/27/science/scientists-experiments-replication-ai.html
1•bookofjoe•8m ago•1 comments

PushVideoAI – Turn PDFs and prompts into digital products instantly

https://pushvideoai.com/
1•susannadavidkel•9m ago•0 comments

New Social Network

https://vulpine.pw/
1•AJesdizahozao•10m ago•2 comments

Mullvad Shuts Down Public Encrypted DNS Servers and Sponsors Quad9 Instead

https://digitalescapetools.com/2026/09/mullvad-shutting-down-dns-quad9.html
2•xabd•10m ago•0 comments

Replacing a Rust Enum with a 64-Bit Word Made My Interpreter 17% Faster

https://pointersgonewild.com/2026-08-25-replacing-a-rust-enum-with-a-64-bit-word/
2•metrofun•12m ago•0 comments

Nvidia is driving the AI boom. Good

https://www.economist.com/leaders/2026/09/03/nvidia-is-driving-the-ai-boom-good
1•Anon84•12m ago•0 comments

Terminal.army

https://terminal.army/
1•ncdlek•14m ago•1 comments

The jobs apocalypse is postponed. An AI jobs boom is here

https://www.economist.com/finance-and-economics/2026/09/04/the-jobs-apocalypse-is-postponed-an-ai...
1•Anon84•14m ago•0 comments

Microsoft Project Zenith: A ready-to-code Windows setup for developers

https://blogs.windows.com/windowsdeveloper/2026/09/04/announcing-project-zenith-the-ready-to-code...
1•CoderLim110•16m ago•0 comments

A bizarre Commodore 64 peripheral, a mime, and some pretty bad ads

https://buttondown.com/suchbadtechads/archive/spartan-and-the-mime/
1•rfarley04•20m ago•0 comments

Gleam and BEAM- Looking beyond the JVM [video]

https://vimeo.com/1223666800
1•kamilap•20m ago•0 comments

SchedBlame: Culprit-Attributed CPU Contention on Stock Kernels

https://arxiv.org/abs/2609.02052
1•torsi0n•21m ago•0 comments

Self Aware Models Win

https://paperclips.blog/dario-is-most-self-aware
1•andytratt•24m ago•1 comments

Juraslip Park

https://github.com/panglesd/slipshow/releases/tag/v0.13.0
1•panglesd•25m ago•0 comments

New method predicts where massive earthquakes will strike

https://news.ucr.edu/articles/2026/09/04/new-method-predicts-where-massive-earthquakes-will-strike
1•geox•26m ago•0 comments

Xxcancel.com – redirect to a working nitter instance

3•DavCreator•27m ago•0 comments

Billionaires Are Funding 'Anti AI' Content [video]

https://www.youtube.com/watch?v=mzlu4FSXBNw
2•blurbleblurble•27m ago•0 comments

StackKit – In-depth index of low-exposure open-source dev tools

https://stackkit.website/
1•StackKit•29m ago•0 comments

I Found a Self-Propagating Worm Hiding Inside [.vscode] in My Own Commits

https://medium.com/@simongideon918/i-found-a-self-propagating-worm-hiding-inside-vscode-my-own-co...
2•syumei•30m ago•0 comments

Show HN: Minilith – A zero-dependency CMS stored inside a PNG file

https://blog.minilith.site/#posts/minilith-architecture
4•a_bytecycle•34m ago•2 comments

Implementation of GCC's Nested Functions (vs. C++ Lambdas)

https://uecker.codeberg.page/2026-09-05.html
1•uecker•34m ago•0 comments

Release 0.12.10 · astral-sh/uv

https://github.com/astral-sh/uv/releases/tag/0.12.10
1•kyisaiah47•35m ago•0 comments

AI-Generated Code to Production-Ready Software

https://geekyants.com/guide/building-an-ai-native-delivery-partnership-turning-ai-generated-code-...
2•jamessmith789•36m ago•0 comments

75% of resumes are rejected by ATS" statistic are wrong

https://www.resumeadapter.com/ats-statistics
1•acjm•37m ago•0 comments

Homelabbing in Nepal

https://berojgarengineer.com/blog/homelab-in-nepal/
1•rbbcap•40m ago•0 comments

Qtyuo

1•cngtu•40m ago•0 comments

Agents need to be more selfish

https://nonlineartransform.substack.com/publish/post/214182359
1•program_whiz•44m ago•0 comments

After the Offline Write: Durable Server Work in Syncular

https://syncular.dev/blog/durable-server-work/
1•quambo•45m ago•0 comments