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

OpenTofu builds the house, Ansible furnishes it

https://ryancheley.com/2026/11/16/opentofu-builds-the-house-ansible-furnishes-it/
1•speckx•1m ago•0 comments

Compression of the RH Proof

https://riemann.verifytask.cn/
1•rzk•1m ago•0 comments

Famous Books That Were Written Under the Influence of Drugs

https://www.mentalfloss.com/literature/books/books-written-under-influence-drugs
1•ohjeez•2m ago•0 comments

Press START to prove your age

https://www.law.kuleuven.be/citip/blog/press-start-to-prove-your-age-how-the-eu-kids-act-could-ag...
2•jruohonen•3m ago•1 comments

All 84 public ARTEX forks and copies,with stars, version and last push

https://www.artex.sh/forks
1•Bender•3m ago•0 comments

How do you track '3x per week' habits without breaking streaks?

https://leewayhabits.netlify.app/
1•NoProbs•6m ago•0 comments

Checking agent code against your intent

https://leangineer.com/blog/checking-agent-code/
1•saviorand•6m ago•0 comments

Dissolving the Fermi Paradox (2018)

https://arxiv.org/abs/1806.02404
1•gradus_ad•8m ago•0 comments

C++26 is done (again): November 2026 ISO C++ meeting trip report

https://herbsutter.com/2026/11/21/c26-is-done-again-trip-report-november-2026-iso-c-standards-mee...
1•dverlaeckt80•11m ago•0 comments

Microsoft 365 Outage – Post Incident Report [pdf]

https://tianyin.github.io/misc/pir_microsoft_365_11-12-2026.pdf
1•birdculture•12m ago•0 comments

Points on Curves [pdf]

https://alpo.ge/papers/my%20thesis.pdf
1•ronfriedhaber•13m ago•0 comments

The Problem Solvers – Anton Osika at Lovable [video]

https://www.youtube.com/watch?v=rjSvJYrVY2k
1•doener•14m ago•0 comments

Overwhelmed routers from 2001 grounded all US flights on Friday

https://www.tomshardware.com/networking/two-hpe-juniper-network-routers-grounded-all-the-us-fligh...
1•ohjeez•15m ago•0 comments

Croon – Live dubbing for whatever's playing on your iPhone

https://apps.apple.com/us/app/croon-live-video-translator/id6799599735
1•CROON_tv•15m ago•0 comments

Norway to extend proposed under-16 social media ban to games and messaging apps

https://www.euronews.com/2026/10/19/norway-to-extend-proposed-under-16-social-media-ban-to-online...
12•geox•16m ago•0 comments

Show HN: Fly through your LinkedIn network in a 3D galaxy

https://thisiscoco.app/atlas
1•theDGA•17m ago•0 comments

Ask HN: Are the trades a safe career transition?

3•Rd6n6•18m ago•1 comments

Machine learning interatomic potential can infer electrical response (2025)

https://www.nature.com/articles/s41524-025-01911-z
1•HiPHInch•19m ago•0 comments

Colors are our embeddings of light: an intuition for tokens and embeddings

https://fedemagnani.github.io/llm/2026/11/22/colors-are-our-embeddings-of-light.html
2•drunello•21m ago•0 comments

Stingless bees in Peru become first insects to be granted legal rights

https://animalsurvival.org/trade-and-legislation/how-stingless-bees-in-peru-became-the-worlds-fir...
2•vismit2000•22m ago•0 comments

Show HN: Discord:Client – A Discord API Library for Perl

https://github.com/viasnake/Discord-Client
1•viasnake•27m ago•0 comments

Europe weakens chemical rules as science links them to 'lifestyle diseases'

https://www.lemonde.fr/en/opinion/article/2026/11/22/as-science-increasingly-shows-the-role-chemi...
20•atmosx•28m ago•1 comments

The EU Commission has been the victim of a cyberattack carried out using AI

https://www.eunews.it/en/2026/11/19/the-eu-commission-has-been-the-victim-of-a-cyberattack-carrie...
3•jruohonen•34m ago•0 comments

Exploring Multimodal Neurons [video]

https://www.youtube.com/watch?v=jp09C8ZI3o4
1•lroe•35m ago•0 comments

I joined the NTP Pool, but not with my Stratum 1 Pi

https://www.jeffgeerling.com/blog/2026/i-joined-the-ntp-pool/
2•fortran77•35m ago•0 comments

ESP32 Wi-Fi terminal driving an IBM MDA monochrome CRT [video]

https://www.youtube.com/watch?v=xYlgi_Qrdpc
1•fortran77•36m ago•0 comments

Clinging

https://joecarlsmith.com/2021/01/24/on-clinging/
2•highfrequency•39m ago•0 comments

Saktum Check – test MCP servers against the OWASP MCP Top in one command

https://github.com/soodhere/saktum-check
1•soodherecanada•40m ago•0 comments

I built a free, self-hosted tool that flags problems in pcap files

https://pcap-analyzer-seven.vercel.app/#demo
2•noviembrepunk•41m ago•0 comments

Run a Gitea DinD Runner with Rootless Podman

https://www.nite07.com/en/posts/gitea-runner-rootless-podman/
2•speckx•42m ago•0 comments