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

Blog: How the Python ecosystem responded to the eMudhra intermediate compromise

https://pyfound.blogspot.com/2026/11/how-python-ecosystem-responded-to.html
1•miketheman•22s ago•0 comments

OpenAI Renames Datacenters "Compute Campuses" [pdf]

https://cdn.openai.com/pdf/compute-campus-policy-blueprint.pdf
2•iamronaldo•1m ago•0 comments

'There Is One Fight': American Voters Reject Tech Oligarchy

https://www.404media.co/there-is-one-fight-american-voters-reject-tech-oligarchy/
2•Frieren•2m ago•0 comments

Mastra Skills – A curated collection for Mastra developers

https://github.com/YGhorbel/awesome-mastra-skills
2•yassineghorbelr•2m ago•0 comments

Witchcraft as Contagion

https://complexstories.uvm.edu/salem-witches/
3•speckx•2m ago•0 comments

Thoughts on Science vs. Magical Thinking

https://ghrelin.bearblog.dev/science/
2•madprops•3m ago•0 comments

80k Hops per Second Measurement Confirm Starlink Up/Downlink Channel Pairing

https://sdr-x.github.io/starlink-ul-dl-pair-80k-hop-ad9361/
2•fortran77•4m ago•0 comments

The architecture of open-weight LLMs: MoE, hybrid layers, ternary weights

https://www.silasdata.com/llm-playground-inside-architectures/
2•silasyl•4m ago•0 comments

Dense in Depth: Rethinking Security When Vulns Are Everywhere

https://medium.com/@TalBeerySec/dense-in-depth-rethinking-security-when-vulns-are-everywhere-229d...
3•el_duderino•5m ago•0 comments

Let's Talk About Black October

https://blog.gradle.org/lets-talk-about-black-october
2•torutofu•5m ago•0 comments

Models led prediction markets in forecasting the blue wave

https://www.natesilver.net/p/models-led-prediction-markets-in
2•7777777phil•7m ago•0 comments

Several European flights receive bomb threats, some divert

https://www.dw.com/en/several-european-flights-receive-bomb-threats-some-divert/a-79861216
2•N19PEDL2•7m ago•0 comments

The Beleaguered Chip Sellers Getting Their Revenge on Apple

https://www.wsj.com/tech/apple-iphone-memory-chips-ai-c0084cc9
2•ksec•8m ago•1 comments

74 years of US political ads

https://admap.org/#2026/
2•Eden09•9m ago•0 comments

Catching Bugs Early: Validating C++ Contracts with Static Analysis [video]

https://www.youtube.com/watch?v=3DDqDKaKmio
1•rramadass•9m ago•0 comments

Are Drone Ports the Next Annoying Neighbor? Flying delivery bots prompt concern

https://spectrum.ieee.org/drone-delivery-noise
2•oldnetguy•10m ago•0 comments

Dropbox Plans to Acquire Tigris

https://www.tigrisdata.com/blog/dropbox-plans-acquire-tigris/
2•xena•11m ago•0 comments

Show HN: Misogi - Do one hard thing this year, coached by your Muse

https://getmisogi.com/
1•ohong•12m ago•1 comments

MCP Explained

https://mcp-explained.com/
9•rwilinski•12m ago•1 comments

Show HN: Sleek Android <-> macOS file transfer app

https://phonemount.app/
1•webarch•12m ago•1 comments

Fortune Telling and Speculative Design

https://maggieappleton.com/fortune-telling
1•mattvr•13m ago•0 comments

Novis-Lang – The programming language for web applications(and the command line)

https://novis-lang.org/
2•AnotherBrainFoo•14m ago•0 comments

Bluesky Gets a Midterms Bump, Ships Pronouns-in-Bios Feature

https://gizmodo.com/bluesky-gets-a-midterms-bump-ships-pronouns-in-bios-feature-2000835322
1•iamnothere•14m ago•0 comments

Foot-stiffening socks reduce the metabolic cost of walking

https://royalsocietypublishing.org/rspb/article/293/2082/20261467/484043/Foot-stiffening-socks-re...
2•PaulHoule•14m ago•0 comments

Show HN: Waymark – A workflow engine that compiles jobs instead of replaying

https://github.com/piercefreeman/waymark
3•icyfox•14m ago•0 comments

Understanding Linear Algebra

https://understandinglinearalgebra.org/home.html
2•ibobev•15m ago•0 comments

Show HN: XSDHub – checks correctness of invoice format and local standards

https://xsdhub.com/e-invoice-validator
2•DroneLedger•15m ago•1 comments

Random Pokémon Generator

1•bloogingaagency•16m ago•0 comments

Practical Guide to Bare Metal C++

https://arobenko.github.io/bare_metal_cpp/
2•ibobev•16m ago•0 comments

Building a Self-Updating AI Pipeline for Expense Extraction

https://czioutas.com/blog/self-learning-loop/
3•cziou•17m ago•0 comments