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

We ended up with Palantir and how to replace it

https://berthub.eu/articles/posts/some-notes-on-palantir/
1•ahubert•1m ago•0 comments

Ask HN: Where AI Researchers Congregate?

1•kosolam•1m ago•0 comments

More Dads Are Scaling Back at the Office for Kids and Housework

https://www.wsj.com/lifestyle/careers/more-dads-are-scaling-back-at-the-office-for-kids-and-house...
1•Anon84•3m ago•0 comments

Technical Coaching: A Side-Quest for Architects

https://www.youtube.com/watch?v=2cqgDKN48ak
1•RebootStr•12m ago•0 comments

The AI Superstars Who Say a 'Vibe Slop' Crisis Is Coming

https://www.wsj.com/tech/ai/vibe-coding-slop-ai-tools-e6a99394
1•doener•13m ago•0 comments

Show HN: Directionally bad – a newsletter about risks of AI centralization

https://deaination.substack.com/p/directionally-bad-issue-002
2•sultee•15m ago•0 comments

Supply chain attacks and OSS sustainability go hand in hand

https://twitter.com/mitchellh/status/2057567975826395606
1•tosh•18m ago•0 comments

Dario and Daniela Amodei on Oprah [video]

https://www.youtube.com/watch?v=w5dJqHilu5s
1•kerim-ca•21m ago•0 comments

Did Google's AI agents build an operating system for $916?

https://www.normaltech.ai/p/did-googles-ai-agents-really-build
1•smartmic•22m ago•0 comments

What spec-driven development gets wrong

https://www.augmentcode.com/blog/what-spec-driven-development-gets-wrong
2•fagnerbrack•29m ago•0 comments

The AI Great Leap Forward (A Warning)

https://mamund.substack.com/p/the-ai-great-leap-forward-a-warning
2•fagnerbrack•30m ago•0 comments

- -dangerously-skip-reading-code – olano.dev

https://olano.dev/blog/dangerously-skip/
1•fagnerbrack•30m ago•0 comments

Post-Primary-Care

https://fulghum.io/post-primary-care
1•jordanf•32m ago•0 comments

Obsidian: The free and flexible app for your private thoughts

https://obsidian.md/
1•doener•33m ago•0 comments

The success of 'natural language programming'

https://brooker.co.za/blog/2025/12/16/natural-language.html
2•jruohonen•36m ago•0 comments

One solution for Maine's struggling fishing industry? Give fillets away for free

https://www.npr.org/2026/05/23/nx-s1-5756374/food-fish-maine-portland-donations
1•defrost•37m ago•0 comments

Ask HN: Anyone catch the bug in codex with /goals?

1•Justlayme•38m ago•0 comments

3 years on from laying off over 1k, Hasbro encouraging survivors to not unionize

https://www.pcgamer.com/gaming-industry/3-years-on-from-laying-off-over-1-000-people-hasbro-and-w...
2•Michelangelo11•38m ago•0 comments

The Documentary That Drops You into a Class War [with Murder] [video]

https://www.youtube.com/watch?v=IlId4uqzUfA
1•burnt-resistor•40m ago•0 comments

The Pkg.go.dev API

https://go.dev/blog/pkgsite-api
1•tjek•42m ago•0 comments

Spas Are Just Harder, and Always Will Be (2013)

http://wgross.net/essays/spas-are-harder
1•downbad_•43m ago•0 comments

What the $#@! is Parallelism, Anyhow? (2009)

https://web.archive.org/web/20091103162537/http://software.intel.com/en-us/articles/what-the-is-p...
1•tosh•47m ago•0 comments

Speeding up MuJoCo 460x with Jax

https://www.alexinch.com/blog/mjx
1•ainch•48m ago•0 comments

Antigravity IDE

https://antigravity.google/product/antigravity-ide
1•lastdong•52m ago•0 comments

To ODC or Not to ODC: Insight for May 2026

https://www.swfound.org/publications-and-reports/to-odc-or-not-to-odc-insight-2026
1•T-A•58m ago•0 comments

SerpSpur vs. SEO Giants

1•WildSense•1h ago•0 comments

What the hell are we doing?

https://addisoncrump.info/research/what-the-hell-are-we-doing/
2•jruohonen•1h ago•0 comments

Ongoing Supply Chain Attack on Composer Packages

https://twitter.com/AikidoSecurity/status/2057958510445658144
1•SweetSoftPillow•1h ago•0 comments

Jd

https://code.jsoftware.com/wiki/Jd/Overview
2•tosh•1h ago•0 comments

Release 02 Announcement

https://www.war.gov/UFO/?releaseDate=Release+02
1•aggrrrh•1h ago•0 comments