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

30K Users WTF

https://weatherhubapp.com/
1•WeatherHub•57s ago•0 comments

Lies We Tell Ourselves About Email Addresses

https://gitpush--force.com/commits/2026/06/lies-we-tell-ourselves-about-email/
1•theanonymousone•1m ago•0 comments

Dropstone – a coding agent running DeepSeek/Kimi on US no-retention servers

https://blankline.org/research/dropstone-1-5
1•DarenWatson•1m ago•0 comments

How to Set Up DMARC for Google Workspace: A Step-by-Step Guide

https://dmarcguard.io/blog/dmarc-google-workspace-setup/
1•meysamazad•1m ago•0 comments

Water Is Strange

https://bfloeser.de/water-is-strange
1•meysamazad•2m ago•0 comments

Dhewm3 1.5.5 Released

https://dhewm3.org/#dhewm3-1.5.5
1•klaussilveira•3m ago•0 comments

Flying cars are finally arriving

https://www.notboring.co/p/expanding-the-radius-of-daily-life
1•tsungxu•3m ago•0 comments

Ask HN: Which companies gained a competitive edge purely via engineering?

1•j1000•4m ago•0 comments

Artists`re making antislop to rebel against AI:It's been rammed down our throats

https://www.theguardian.com/technology/2026/jun/08/anti-slop-ai-art
2•rndsignals•5m ago•0 comments

Oxford University discloses data breach after careers platform hack

https://www.bleepingcomputer.com/news/security/oxford-university-discloses-data-breach-after-care...
1•Brajeshwar•7m ago•0 comments

Odroid-H5 SBC with 4xM2 Slots and 10GbE

https://www.hardkernel.com/shop/odroid-h5/
2•andruby•7m ago•0 comments

Natural England demands salt marshes before Hinkley Point C opens

https://www.msn.com/en-gb/news/other/natural-england-demands-salt-marshes-before-hinkley-point-c-...
1•ksec•7m ago•0 comments

sama: "man the early days of the internet were so special"

https://twitter.com/sama/status/2062661191969972645
2•smlavine•7m ago•0 comments

Who Runs Your Rust Future? Hands-On Intro to Async Rust

https://aibodh.com/posts/async-rust-chapter-1-hands-on-intro-to-async-rust/
1•febin•10m ago•0 comments

Successful Arbitrage, or the Art of Always Landing on Its Feet Like a Cat

https://www.functori.com/blog/blog-successful-arbitrage.html
1•cago•10m ago•0 comments

Could this be the perfect IT-escape [video]

https://www.youtube.com/watch?v=W6aJCSi7qEQ
1•raadore•10m ago•0 comments

Breaking BitLocker Again

https://twitter.com/jonasLyk/status/2062768028090007773
1•Fulgen•15m ago•0 comments

Scientists Activate Sleep's Restorative Benefits in Awake Brain Regions

https://bioengineer.org/scientists-activate-sleeps-restorative-benefits-in-awake-brain-regions/
1•geox•16m ago•0 comments

Beta Feedback – live video app where everyone watches one person at a time

2•Tutati_app•18m ago•0 comments

Google Photos Bulk Editing (Chrome Extension)

https://batchphotoedit.com/
1•levinyair•18m ago•0 comments

Facebook is paying people overseas promoting Alberta separatism

https://www.cbc.ca/news/canada/facebook-overseas-alberta-separtism-9.7223966
3•robtherobber•20m ago•1 comments

Show HN: GitHub Copilot port of Anthropic's AI vulnerability discovery harness

https://github.com/davidreis97/defending-code-reference-harness-copilot
1•dreis_sw•20m ago•0 comments

Show HN: Performative-UI – a react component library of design tropes

https://vorpus.github.io/performativeUI/
4•lizhang•21m ago•0 comments

Letting OpenClaw run wild in Simulation

https://veris.ai/blog/let-openclaw-run-wild-in-simulation
5•jrm-veris•21m ago•0 comments

SWE Marathon

https://www.swe-marathon.org/
1•AlexClickHouse•22m ago•0 comments

Lawmakers Abandon Trump on Warrantless Wiretapping

https://www.wsj.com/politics/policy/trump-faces-bipartisan-backlash-over-spy-bill-as-deadline-loo...
1•LostMyLogin•22m ago•0 comments

404NOT403 – HTTP forensic scanner and URL change monitor

https://404NOT403.com
1•psiloconvalley•23m ago•0 comments

Show HN: I built a Fujifilm X-mount lens database across 10 brands

https://atlens.app/en/lenses/x/browse
2•sentacraft•25m ago•0 comments

How many consecutive hyphens can you have in a domain name?

https://shkspr.mobi/blog/2026/06/how-many-consecutive-hyphens-can-you-have-in-a-domain-name/
2•Brajeshwar•25m ago•0 comments

SoulsOnly.tff – A font for humans not AI and keyboard firmware to type in it

https://github.com/convictional/souls-only
3•billtarbell•25m ago•1 comments