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

A few geek quizzes for time to pass

https://textlog.cc/tag/quiz?chunk=5
1•stagas•2m ago•0 comments

Pyshackle: A hard pre-execution gate for AI agent tool calls (open source)

https://pypi.org/project/pyshackle/
1•SHACKLE-PRO-•3m ago•0 comments

Map of stars around Earth out to 40 light years

https://claude.ai/code/artifact/872ab302-5cb2-4a95-ae66-7c0144177b53
1•EthanHeilman•6m ago•0 comments

US diplomat secretly flown home ‘had child abuse images at flat’

https://www.thetimes.com/uk/crime/article/us-diplomat-flown-home-immunity-bv58b3v7q
3•Betelbuddy•7m ago•1 comments

Dario Amodei says China presents 'toughest dilemma' for his proposed AI slowdown

https://www.cnbc.com/2026/09/13/china-dilemma-ai-slowdown-anthropic.html
3•donsupreme•10m ago•0 comments

Show HN: Pinocchio: Harness for Verifiable Work

https://pinocchio.goedelmachines.com
1•lazaruslong•11m ago•0 comments

MOBA: Mixture of Block Attention for Long-Context LLMs

https://arxiv.org/abs/2502.13189
1•ur-whale•11m ago•0 comments

Show HN: sengi.ai — Verified candidate sourcing for hard-to-fill roles

https://sengi.ai/
1•vmalyi•15m ago•0 comments

GCC 13.5 Released With 265 Bug Fixes

https://www.phoronix.com/news/GCC-13.5-Released
2•fork-bomber•19m ago•0 comments

Qalb: A programming language that uses the Arabic script instead of Latin

https://nas.sr/%D9%82%D9%84%D8%A8/
1•Muhammad523•20m ago•1 comments

Show HN: An agent that calculates how energy levels affect your goal progression

https://www.youtube.com/watch?v=FVUH2mna41g
1•ifeanyi_sa•21m ago•0 comments

The Case of Yemen's .YE Country-Code Domain

https://freethedotye.org/blog/when-militia-owns-ye/
2•FreeTheDotYE•25m ago•0 comments

How Mike Will Made It

https://www.newyorker.com/magazine/2016/07/11/how-mike-will-made-it
2•georgex7•26m ago•0 comments

AI recursive self-improvement might not come so quickly after all (August 2026)

https://www.technologyreview.com/2026/08/18/1142188/ai-recursive-self-improvement/
6•dgellow•34m ago•1 comments

Flock cameras used to arrest a child for playing on a swing

https://www.youtube.com/watch?v=koclOnlde0E
37•chadgpt3•36m ago•12 comments

The History of the Internet - Tay Zonday [video]

https://www.youtube.com/watch?v=y15olL4kzOA
1•CharlesW•37m ago•0 comments

Playing Bad Apple on the brain of a simulated fruit fly

https://www.reddit.com/r/oddlyterrifying/comments/1w9yhqv/playing_bad_apple_on_the_brain_of_a_sim...
2•robotnikman•38m ago•0 comments

Ask HN: One month, zero paying customers – keep it or kill it?

2•iGag•41m ago•3 comments

Molt – Thermally aware QLORA fine-tuning for Windows laptop GPUs

https://github.com/PraveenNimilka/MOLT
1•PraveenNimilka•41m ago•0 comments

AI Agent Doesn't Need a Bigger Prompt. It Needs a Data Catalog

https://aeroscissorz.github.io/aeroscissorz/posts/knowledge-catalog/
2•aeroscissorz1•43m ago•0 comments

What Is to Be Done? (2023)

https://twitter.com/pmarca/status/1666113642709020672
1•tosh•46m ago•0 comments

The tab is coming due for America's borrowing binge

https://www.axios.com/2026/09/13/national-debt-interest-rates-rising
2•toomuchtodo•46m ago•2 comments

Image to SVG in the browser, with no upload and real point editing

https://getsvg.app/
2•msmode•46m ago•0 comments

Calspan Bicycle and Motorcycle Dynamics Reports

http://bicycle.tudelft.nl/schwab/Bicycle/calspan/
1•Bluestein•47m ago•0 comments

Google is ending Gmail 'Send as' support for third-party accounts

https://proton.me/blog/gmail-ends-send-as-third-party
2•sltkr•48m ago•0 comments

The Air Computer

https://thechipletter.substack.com/p/the-air-computer
2•klelatti•48m ago•0 comments

Suicidal Compassion: Utilitarianism at AI Companies Endangers Humanity

https://ai-frontiers.org/articles/suicidal-compassion-how-utilitarianism-at-ai-companies-endanger...
3•YeGoblynQueenne•50m ago•0 comments

Government Survey Finds More Screentime Means Lower Scores for Japanese Students

https://www.nippon.com/en/japan-data/h02871/
3•akyuu•51m ago•0 comments

Rhizome ArtBase

https://artbase.rhizome.org/wiki/Main_Page
4•themaxdavitt•51m ago•0 comments

One event, five status codes and a class

https://percentes.ai/writing/2026/one-event-five-status-codes-and-a-class/
3•itsveems•52m ago•0 comments