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

CIA Reorganization Prioritizes Cyberoperations

https://www.nytimes.com/2026/06/30/us/politics/cia-reorganization-cyber-ai.html
1•ChrisArchitect•21s ago•0 comments

Show HN: Turning Sentry errors into AI generated GitHub PRs with fixes

https://bugzero.dev
1•rafalswietek•1m ago•0 comments

US Army Women Are More Likely to Be Killed by Army Men Than by War

https://theintercept.com/2026/06/30/army-women-death-domestic-violence-sexual-assault/
2•rendx•6m ago•0 comments

NPR retracts story about Alito retirement

https://www.npr.org/sections/npr-public-editor/2026/06/30/g-s1-131107/npr-retracts-story-about-al...
1•petethomas•6m ago•0 comments

Daily step count of remote workers associated with lower stress and better work

https://medicalxpress.com/news/2026-06-daily-remote-workers-stress.html
1•OutOfHere•6m ago•0 comments

Show HN: Mimir – local-first encrypted memory for AI agents (single Rust binary)

https://github.com/Perseus-Computing-LLC/mimir
1•perseusai•8m ago•0 comments

Understanding lattice risks: Many differences between marketing and reality

https://blog.cr.yp.to/20260630-risk.html
1•ledoge•8m ago•0 comments

Meta's brain-scanning system reads sentences non-invasively, code open source

https://ai.meta.com/blog/brain2qwerty-brain-ai-human-communication/?_fb_noscript=1
2•alok-g•8m ago•1 comments

Superpowers 6

https://blog.fsck.com/2026/06/15/Superpowers-6/
2•seahorseemoji•9m ago•0 comments

Breaking the Bird Barrier: Scientist Decodes Zebra Finch Language

https://www.freepressjournal.in/education/breaking-the-bird-barrier-scientist-decodes-zebra-finch...
1•yyyk•10m ago•0 comments

Wearable foundation models: a brief history

https://www.empirical.health/blog/wearable-foundation-models/
2•brandonb•11m ago•1 comments

May in Servo: user scripts, mp4 compat, blackboxing in DevTools, and more

https://servo.org/blog/2026/06/30/may-in-servo/
1•birdculture•11m ago•0 comments

Go 1.26 Fixed the Things That Were Annoying

https://towardsdev.com/go-1-26-quietly-fixed-the-things-that-were-actually-annoying-5b4876071f04
2•cheikhdev•11m ago•0 comments

FluidVoice - Open source voice-to-text dictation app for macOS with local AI

https://github.com/altic-dev/FluidVoice
1•danboarder•13m ago•0 comments

MS admits 8GB RAM is fine for Win11, after years of pushing 16GB as the baseline

https://www.windowslatest.com/2026/06/25/microsoft-now-says-8gb-ram-is-fine-for-everyday-use-righ...
1•voxadam•15m ago•0 comments

Tell HN: Amazon Linux 2 is EOL today

https://aws.amazon.com/amazon-linux-2/faqs/
2•theschmed•18m ago•1 comments

Ray Tracer in SQL

https://github.com/ClickHouse/RayTracer
2•kbumsik•18m ago•0 comments

Baseline brain scan predicts adolescent depression and anxiety one year later

https://www.medrxiv.org/content/10.64898/2026.06.08.26355206v1
1•Anon84•21m ago•0 comments

SilentJSON – A zero-allocation JSON parser for Go (3.4 GB/s)

https://github.com/GenshIv/silentjson
1•ihariv•21m ago•0 comments

Startups as Reality Contact Machines

https://www.wespiser.com/posts/2026-06-30-reality-contact-machines.html
1•wespiser_2018•22m ago•1 comments

Clash Unfolds as Trump Admin Pushes Intel Agencies to Share Espionage Targets

https://www.nytimes.com/2026/06/29/us/trump-intelligence-agencies-spies-master-list.html
1•pulisse•24m ago•0 comments

The On-Line Encyclopedia of Integer Sequences

https://oeis.org/
1•sambapa•26m ago•0 comments

Automate public TLS certificate issuance with ACME support in AWS ACM

https://aws.amazon.com/blogs/aws/automate-public-tls-certificate-issuance-with-acme-support-in-aw...
1•Old_Recognition•27m ago•0 comments

Myst (Series)

https://en.wikipedia.org/wiki/Myst_(series)
2•doener•27m ago•1 comments

Godot will no longer accept AI-authored code contributions

https://www.pcgamer.com/gaming-industry/open-source-game-engine-godot-will-no-longer-accept-ai-au...
5•evo_9•28m ago•0 comments

Gemini Spark updates: macOS launch, connected apps and more

https://blog.google/innovation-and-ai/products/gemini-app/gemini-spark-updates-june-2026/
1•thanhhaimai•31m ago•0 comments

Bb: The IDE for loop driven development

https://getbb.app/
1•handfuloflight•31m ago•0 comments

The Singham Ground Game

https://www.btcpolicy.org/articles/foreign-influence-campaign-against-american-ai-part-ii-singham...
1•takoid•33m ago•0 comments

Claude Code Just Got 5x More Expensive

https://www.vincentschmalbach.com/claude-code-quietly-looks-5x-more-expensive/
3•vincent_s•33m ago•0 comments

From the Epstein Files to Inside the Manosphere

https://pocketproject.org/event/from-the-epstein-files-to-inside-the-manosphere-tending-to-fractu...
1•rendx•34m ago•0 comments