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

Show HN: Protobuf.com, a visual, interactive guide to Protocol Buffers

https://protobuf.com/
1•sudorandom•2m ago•0 comments

Satellite proliferation imperils astronomical observations, study finds

https://www.reuters.com/business/media-telecom/satellite-proliferation-imperils-astronomical-obse...
1•comebhack•2m ago•0 comments

Computers Compared

https://fly.io/computers-compared/
1•jacobwg•2m ago•0 comments

Apple Accidentally Leaked More Than 10 New Products in macOS Update

https://www.macrumors.com/2026/08/19/apple-leak-macos-26-7/
2•dotmanish•3m ago•0 comments

ShieldFont

https://shieldfont.org/encoder/
1•bookofjoe•3m ago•0 comments

How to Outsmart AI When It's Tracking Your Workda

https://www.wsj.com/lifestyle/workplace/how-to-outsmart-ai-when-its-tracking-your-workday-3ad6907e
1•cebert•6m ago•1 comments

Supply Chain Attack on Arrayref

https://blog.rust-lang.org/2026/08/20/supply-chain-attack-on-arrayref/
1•praseodym•9m ago•0 comments

How Many Fundamental Constants Are There? (2011) John Baez

https://math.ucr.edu/home/baez/constants.html
2•lioeters•9m ago•0 comments

Rust arrayref 0.3.10 crate installs malware

https://github.com/rustsec/advisory-db/issues/3161
1•jedisct1•10m ago•0 comments

The Facebook Files

https://www.wsj.com/articles/the-facebook-files-11631713039
1•root-parent•13m ago•1 comments

Has Stock Market Participation Changed How Interest Rates Affect the Economy?

https://libertystreeteconomics.newyorkfed.org/2026/08/has-broader-stock-market-participation-chan...
1•root-parent•15m ago•0 comments

AI fired an S.F. store employee. Will California crack down on 'robobosses'?

https://www.sfchronicle.com/politics/article/andon-market-robobosses-bill-22393579.php
3•OutOfHere•16m ago•1 comments

An approach to vulnerability observability of Go services leveraging Prometheus

https://github.com/el10savio/vulnemetry/tree/main
1•ugabuga•17m ago•0 comments

If this is true, the hyperscalers are toast

https://klementoninvesting.substack.com/p/if-this-is-true-the-hyperscalers
4•root-parent•17m ago•1 comments

Dutch data protection authority advises Twitch users to opt out from Amazon AI

https://www.autoriteitpersoonsgegevens.nl/en/current/ap-advises-twitch-users-opt-out-from-sharing...
5•HelloUsername•19m ago•0 comments

India's Battle for Free Internet

https://web.archive.org/web/20260820103426/https://www.linkedin.com/pulse/indias-battle-free-inte...
1•5d41402abc4b•20m ago•0 comments

Don't paste the AI, please (angry way)

https://dontpastetheai.com/angry/
1•krehwell•20m ago•0 comments

The "Nana Benz" of Togo

https://www.togoarchives.com/the-nana-benz-of-togo/
1•prmph•21m ago•0 comments

Living near dry cleaners linked to higher Parkinson's odds in older adults

https://parkinsonsnewstoday.com/news/living-near-dry-cleaners-may-raise-parkinsons-odds-older-adu...
2•downbad_•21m ago•0 comments

Some prostate cancers can be diagnosed without invasive biopsy,new study reveals

https://www.the-independent.com/life-style/health-and-families/health-news/nhs-prostate-cancer-uc...
2•teleforce•22m ago•0 comments

US Government debt hits $40T as borrowing rises at historic rate

https://www.ft.com/content/673f8c35-1433-479f-803f-0597cbe7ef74
3•tcp_handshaker•23m ago•1 comments

Susan Kare: Designing Icons and Graphics for the Original Mac

https://www.youtube.com/watch?v=YEvLKzsEwMw
1•ksec•26m ago•0 comments

Pine AI getting 75.4% (SoTA) on τ³-Voice Leaderboard

http://taubench.com/leaderboard/
6•danielglh•31m ago•0 comments

Znuny: OTRS OSS

https://www.znuny.org/en
1•sts153•34m ago•1 comments

Show HN: Ideal Weight, BMI and Body Fat Calculator Tool

https://www.globaltoolsbox.online/2026/08/ideal-weight-calculator-bmi-body-fat.html
1•solangiwaqas•34m ago•0 comments

Structural Predictions for the AI Era

https://www.newnex.io/news/12-structural-predictions-for-the-ai-era-ai-object-framework-aof
1•afr99•35m ago•1 comments

Show HN: Fail CI when your stack runs end-of-life software

https://github.com/endoflife-ai/eol-check
2•ScottUbiquitous•36m ago•0 comments

Risk Engineering

https://risk-engineering.org/
2•throwaw12•37m ago•0 comments

Whoop replacement noop 10.5 released

https://github.com/ryanbr/noop
2•mp3geek•39m ago•0 comments

Why AGI Is Impossible

https://substack.com/@vinialva/note/c-312693792
6•vinialva•40m ago•1 comments