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

Forensic dissection of Roland J-6's 64 presets: measuring the hidden settings

https://github.com/liotier/RolandStuff/blob/main/J-6_presets_measurement/README.md
1•liotier•1m ago•0 comments

Is Ssense Pivoting to AI Slop?

https://www.thecut.com/article/is-ssense-pivoting-to-ai-slop.html
1•randycupertino•2m ago•1 comments

Your target market isn't demographic (2025)

https://longform.asmartbear.com/target-market/
1•mooreds•3m ago•0 comments

How to generate an accessible color palette from a single color

https://taisho.design/en/blog/accessible-color-palette-from-one-color
2•PabloDiFIlippo•5m ago•0 comments

Scaling Postgres to 1M durable workflows per second

https://www.dbos.dev/blog/one-million-workflows
1•KraftyOne•5m ago•0 comments

Show HN: Primeward – Exploring a stateful recurrence for the next prime

1•alexhr•13m ago•0 comments

Vulcan Street Plant

https://en.wikipedia.org/wiki/Vulcan_Street_Plant
1•_doctor_love•15m ago•0 comments

Catching Crumbs from the Table [pdf]

https://gwern.net/doc/fiction/science-fiction/2000-chiang.pdf
2•gchamonlive•15m ago•1 comments

Show HN: Jam – A music making game where you play gigs to earn studio gear

https://jam.resonantdsp.com
1•garrinm•17m ago•0 comments

Athanor (furnace)

https://en.wikipedia.org/wiki/Athanor
1•_doctor_love•23m ago•0 comments

Show HN: Park – save and recall work context across repos and machines

https://svandragt.github.io/park/
1•pacifika•25m ago•3 comments

Ask HN: How do you keep code review skills when agents write most of the code?

1•robinmin•25m ago•0 comments

Re: Riemann

https://borretti.me/article/re-riemann
4•_dain_•26m ago•0 comments

Petrucci Music Library

https://imslp.org
1•yetanotheruser•32m ago•0 comments

Help github just deleted me

https://nate.mecca1.net/posts/2026-11-20_help/
37•01nate•33m ago•17 comments

AI models change their answers when they are monitored

https://www.jordannews.jo/Section-129/Technology/AI-models-change-their-answers-when-they-are-mon...
2•nreece•35m ago•0 comments

Show HN: SaturnSQL Context, telling AI tools what the database means

https://saturnsql.com/context-layer
2•infr88•36m ago•0 comments

Real-Time Video on Embedded Linux Cameras with WebRTC

https://interrupt.memfault.com/blog/real-time-video-webrtc
2•hasheddan•36m ago•0 comments

Uncontacted Indigenous people emerge from Amazon forest to ask for food

https://www.washingtonpost.com/world/2026/11/19/uncontacted-indigenous-people-emerge-amazon-fores...
12•Teever•37m ago•0 comments

A human liver has been kept alive outside the body for a record seven weeks

https://www.technologyreview.com/2026/11/19/1148934/a-human-liver-has-been-kept-alive-outside-the...
8•bookofjoe•38m ago•1 comments

Officials approved the sale of 580k Nvidia chips to Chinese companies

https://www.washingtonpost.com/technology/2026/11/20/officials-approved-sale-580000-nvidia-chips-...
7•cdrnsf•38m ago•2 comments

Serious cyberattack thought backed by wealthy operators

https://www.ruv.is/english/2026-11-20-serious-cyberattack-thought-backed-by-wealthy-operators-493411
4•Bender•39m ago•1 comments

White House removes cyber-security chief after series of tech outages

https://www.bbc.com/news/articles/cwz0k3nn5p5mo
4•Lyngbakr•42m ago•0 comments

How to Be a 10x Engineer in 2027 and Beyond

https://serce.me/posts/2026-11-19-how-to-become-a-10x-engineer-in-2027-and-beyond
2•SerCe•43m ago•0 comments

ICE details Princeton neuroscientist claiming asylum

https://www.theguardian.com/us-news/2026/nov/20/princeton-doctoral-student-reportedly-detained-ice
6•angry_octet•44m ago•2 comments

The Riemann Hypothesis and a Happy Meal

https://zlxie.com/2026/11/21/riemann-hypothesis/
2•mostbill•46m ago•0 comments

Sir Brian May adds new dimension to Hera asteroid

https://www.esa.int/articles/about-us/directorates/operations/space-safety/hera/sir-brian-may-add...
10•mooreds•49m ago•0 comments

Professional Counting Solutions for Your Industry

https://countthings.com/
2•mooreds•49m ago•0 comments

I have been unemployed for 2y.15YOE,US.What to do?

12•LetThingsBeDiff•50m ago•11 comments

Tor Books Removes Book Cover Generated with AI

https://bsky.app/profile/torbooks.bsky.social/post/3n2r7ra4rki2w
4•cdrnsf•54m ago•0 comments