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

SunCalc – sunrise, sunset, shadow length, solar eclipse

https://www.suncalc.org
1•gregsadetsky•58s ago•0 comments

Picking a domain name is hard

https://aetherspe.cc/blog/20260925-picking_a_domain_name_is_hard/
1•weakened_malloc•5m ago•0 comments

Show HN: Sitcom Flavour – Season your Claude Code chats with sitcom replies

https://ada.tools/sitcom-flavour/
1•EmreErkan•5m ago•0 comments

Stanford used AI to replace Hispanic student with Black woman in photo

https://www.msn.com/en-ca/money/general/stanford-used-ai-to-replace-hispanic-student-with-black-w...
1•pykello•8m ago•0 comments

Goodbye Google

https://robert.ocallahan.org/2026/09/goodbye-google.html
2•Murmuring9087•17m ago•0 comments

Krakatoa, an interactive 2.5D painting of the 1883 eruption

https://www.echohive.ai/experiments/krakatoa
1•echohive42•17m ago•0 comments

Jev Based Code Review

https://github.com/egma-ai/jev-code-reviewer
1•namanbhulawat•20m ago•1 comments

Plex: Remote Streaming via Third-Party Apps to Require a License

https://netguide.io/news/en/2026/09/22/plex-remote-streaming-via-third-party-apps-to-require-a-li...
2•sippingabonedry•21m ago•0 comments

Proofmode

https://proofmode.org/
2•F3nd0•23m ago•0 comments

Vulnerability Cve-2026-82958

https://vulnerability.circl.lu/vuln/cve-2026-82958
1•anonyoum•28m ago•0 comments

What your phone is made of

https://anas-sabbar.ca/writing/what-your-phone-is-made-of/
2•Roccan•29m ago•0 comments

Fzakaria/omnibin: Every binary nixpkgs ever shipped, on your PATH

https://github.com/fzakaria/omnibin
1•Tomte•29m ago•0 comments

Finding Bugs

https://matklad.github.io/2026/09/19/finding-bugs.html
1•jamilbk•32m ago•0 comments

What's New in Oracle Solaris 11.4 SRU 95

https://blogs.oracle.com/solaris/whats-new-in-oracle-solaris-11-4-sru-95
2•zdkaster•35m ago•0 comments

Pompeii test case demonstrates Gaussian Splatting's potential

https://www.gim-international.com/news/pompeii-test-case-demonstrates-gaussian-splatting-s-potent...
1•bryanrasmussen•35m ago•0 comments

Every Package Is Installed

https://fzakaria.com/2026/09/24/every-package-is-already-installed
1•ghuntley•38m ago•0 comments

Perch: Semantic Code Linting with Jev

https://github.com/lakeday-org/perch
1•handfuloflight•39m ago•0 comments

Is indirect prompt injection still a big threat as models get more advanced?

https://realarcherl.github.io/posts/prompt_injection/
3•ArcherL•46m ago•4 comments

AI/ML Engineer

https://docs.google.com/forms/d/e/1FAIpQLSdrsnW2CpvYDBRZnS91cL4nXgnvi1mwQSYqF6IhvGPImaLKYw/viewform
1•lets_talk•59m ago•0 comments

We Built Safety into Muse

https://research.meta.ai/blog/security-and-safety-for-ai-agents-our-approach-with-muse
1•AnhTho_FR•1h ago•0 comments

Micron Technology sucessfully demonstrates first 512GB DDR5 RDIMM module

https://investors.micron.com/news/press-release/2026/Micron-Advances-Memory-Innovation-With-the-W...
1•peter_d_sherman•1h ago•0 comments

September's ozone hole biggest in 20 years, warning signs appeared months ago

https://www.rnz.co.nz/news/science-and-technology/1572285/september-s-ozone-hole-biggest-in-20-ye...
3•colinprince•1h ago•0 comments

Collaborative Editing in Wordgard

https://marijnhaverbeke.nl/blog/collaborative-editing-wordgard.html
4•fagnerbrack•1h ago•1 comments

Plan Mode Is Dead

https://www.aymannadeem.com/artificial/intelligence,/developer/tools/2026/09/24/plan-mode-is-dead...
2•jmvldz•1h ago•0 comments

Power your agents: Gemini 3.8 Live with Live Avatar is now generally available

https://cloud.google.com/blog/products/ai-machine-learning/gemini-3-8-live-with-live-avatar-is-no...
1•planteur•1h ago•0 comments

What I Found Out About Organ Donation Shocked Me

https://www.nytimes.com/2026/09/18/opinion/organ-donation-system-ethics-trust.html
3•Alien1Being•1h ago•3 comments

Scalable Subagents

https://github.com/ringlochid/oh-my-subagents
1•ringlochid•1h ago•0 comments

We Built a City of 10k AI Researchers

https://lab.cloud/society/
1•simonpure•1h ago•0 comments

Congestion pricing funds $5M program for overnight truck deliveries in NYC

https://gothamist.com/news/congestion-pricing-funds-5-million-program-for-overnight-truck-deliver...
1•geox•1h ago•0 comments

Show HN: I built 11 Sudoku variants – killer cage generation was the hard part

https://iqiqgame.com/tags/sudoku
1•fang3651•1h ago•1 comments