frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•7mo 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•7mo 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•7mo 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).

Package managers keep using Git as a database, it never works out

https://nesbitt.io/2025/12/24/package-managers-keep-using-git-as-a-database.html
1•zdw•1m ago•0 comments

Mt. Gox CEO Karpelès Reveals Details of 2014 Collapse and Japanese Detention

https://bitcoinmagazine.com/business/former-mt-gox-ceo-mark-karpeles-reveals-details-of-2014-coll...
1•giuliomagnifico•1m ago•0 comments

Show HN: Reginald Expressman - regex game for desktop web

https://bcjordan.com/regexman/
1•bcjordan•5m ago•0 comments

Webhook-based Git analytics across GitHub, GitLab, and Bitbucket

1•akhnid•6m ago•1 comments

Show HN: An open-source anonymizer tool to replace PII in PostgreSQL databases

https://github.com/pgEdge/pgedge-anonymizer
1•pgedge_postgres•6m ago•0 comments

Boundaries Against the Machine

https://blog.talentlms.io/posts/boundaries-against-the-machine/
1•yrizos•7m ago•1 comments

Ask HN: Coding agents struggle to get the current OpenAI API Spec?

1•dcreater•9m ago•0 comments

Determining Current Arm Cortex-M Security State with GDB

https://danielmangum.com/posts/arm-cortex-m-security-state-gdb/
1•hasheddan•9m ago•0 comments

Stylish <Dialog>S

https://fractaledmind.com/2025/12/18/stylish-dialogs/
1•eustoria•10m ago•0 comments

My HTML Web Component boilerplate for 2026

https://gomakethings.com/my-html-web-component-boilerplate-for-2026/
2•eustoria•11m ago•0 comments

Gold, silver and platinum take a breather after record rally

https://www.reuters.com/world/india/gold-tops-4500-silver-platinum-hit-records-metal-markets-fren...
1•teleforce•12m ago•0 comments

Simple Decentralized Identity system in Go

https://github.com/Samuelk0nrad/simple-did
1•samuel_0xK•14m ago•0 comments

Waymo and the Passive Income Society

https://blog.jovono.com/p/waymo-and-the-passive-income-society
1•ejz•15m ago•0 comments

Navigating the High Seas

https://blog.rootsofprogress.org/navigating-the-high-seas
3•weird_user•15m ago•0 comments

5,200 holes carved into a Peruvian mountain left by an ancient economy

https://newatlas.com/environment/5-200-holes-peruvian-mountain/
2•Brajeshwar•17m ago•0 comments

Why the best leaders help their teams to "savor" the world

https://bigthink.com/business/why-the-best-leaders-help-their-teams-to-savor-the-world/
2•Brajeshwar•17m ago•0 comments

3 Minutes 100milion of nodes processed, try this

1•Elecktrike_•18m ago•0 comments

Kitchen Optimizations

https://www.natemeyvis.com/kitchen-optimizations/
1•Theaetetus•18m ago•0 comments

The Xiaomi SU7 Ultra Will End European Cars Forever

https://www.youtube.com/watch?v=IJA8UiZW7lk
1•belter•18m ago•0 comments

Please name your type generics (2025)

https://pert.dev/posts/please-name-your-generics/
2•pure-orange•21m ago•0 comments

Domain Connect: A missing piece in the DNS toolbox

https://blog.apnic.net/2025/12/24/domain-connect-a-missing-piece-in-the-dns-toolbox/
1•8organicbits•21m ago•0 comments

GoGPU: Pure Go GPU Computing Ecosystem

https://github.com/gogpu
1•thunderbong•22m ago•0 comments

Europe slams visa bans after US takes fresh swing at allies over 'censorship'

https://www.reuters.com/world/europe/france-condemns-us-visa-ban-imposed-ex-eu-commissioner-breto...
2•tcumulus•22m ago•1 comments

Show HN: GenresFox Version 0.4.1 Update - This time it really has WASM.

https://github.com/zayokami/GenresFox
1•zayoka•22m ago•2 comments

My 2026 Open Social Web Predictions

https://www.timothychambers.net/2025/12/23/my-open-social-web-predictions.html
2•todsacerdoti•23m ago•0 comments

Show HN: Track Santa with DNS LOC Records

2•ascorbic•25m ago•0 comments

Show HN: I re-built 9 options trading SaaS in 3 months and made it free

https://optionstradingtoolbox.com
1•codenameaustin•27m ago•0 comments

SSH tiny.christmas: A shared terminal Christmas singalong

https://eieio.games/blog/tiny-christmas/
1•meetpateltech•28m ago•0 comments

Detect memory leaks of C extensions with psutil and psleak

https://gmpy.dev/blog/2025/psutil-heap-introspection-apis
2•grodola•29m ago•1 comments

Pay No Attention to the Model Behind the Curtain (2017) [pdf]

https://www.stat.berkeley.edu/~stark/Preprints/eucCurtain15.pdf
2•williamjsdavis•34m ago•0 comments