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

Texas Said It Would Halt Data Center Permits. The State Is Pushing Ahead Anyway

https://www.404media.co/it-aint-right-texas-said-it-would-halt-data-center-permits-the-state-is-p...
1•cdrnsf•19s ago•0 comments

Why AI is not conscious and perhaps never will be

https://www.nature.com/articles/d41586-026-03313-7
1•ersinesen•30s ago•0 comments

The Labor Market for Recent College Graduates

https://www.newyorkfed.org/research/college-labor-market#--:explore:outcomes-by-major
3•birdculture•3m ago•0 comments

Advancing Coding in Low-Resource Programming Languages

https://openai.com/index/low-resource-programming-languages/
1•tech234a•4m ago•0 comments

Software Will Eat Software (2020)

https://www.readmargins.com/p/software-will-eat-software-in-a-remote
1•dzonga•5m ago•0 comments

Blocking Identity Resolution Infrastructure

https://webkit.org/blog/18438/blocking-identity-resolution-infrastructure/
1•wondersky•8m ago•0 comments

Dayfly Mail – Free temporary inbox with selectable lifetime (10M to 3D)

https://dayfly.email/en
1•xianye•10m ago•0 comments

Tell HN: PagerDuty incident causing repeated alerts/escalations

https://status.pagerduty.com/posts/details/PX0PUSQ
1•gtirloni•11m ago•1 comments

Who Verifies the Agents?

https://commentary.dev/blog/who-verifies-the-agents
1•Bootstrapper909•12m ago•0 comments

Show HN: Spacebar – Preview .sqlite3, .geojson, .ipynb and more in the Finder

https://spacebar.greg.technology/
1•gregsadetsky•14m ago•0 comments

Japanese players liken Tekken rollback mod to serious crimes, playerbase split

https://www.ign.com/articles/japanese-tekken-players-are-likening-tekken-6s-rollback-netcode-mod-...
2•anigbrowl•16m ago•0 comments

Elysia 2.0 RC: Rebuilding a JavaScript framework from scratch

https://next.elysiajs.com/blog/elysia-20-rc/
1•saltyaom2•17m ago•1 comments

PyTorch-native TPU back end for vLLM

https://github.com/vllm-project/vllm-torchtpu
1•zniturah•18m ago•0 comments

Profiling the Attack Surface of AI Agent Skills

https://arxiv.org/abs/2610.19264
1•ratneshiiita•19m ago•0 comments

Cronomonitor.com Is Now Live

https://cronomonitor.com
1•iambenc•19m ago•1 comments

Elias in the Lighthouse, Again? Diagnosing Low Diversity in LLM Stories

https://arxiv.org/abs/2605.26492
2•gradus_ad•19m ago•0 comments

No Linus Torvalds, you are not just using a new and interesting tool

https://unixdigest.com/articles/no-linus-torvalds-you-are-not-just-using-a-new-and-interesting-to...
3•iio7•19m ago•0 comments

An ad-free Android TV

https://cretezy.com/2026/ad-free-android-tv
2•CraftThatBlock•20m ago•0 comments

The Singularity: a philosophical analysis [pdf]

https://consc.net/papers/singularity.pdf
2•measurablefunc•22m ago•0 comments

Greg Abbott raked in $9M from data center-related donors

https://www.texastribune.org/2026/10/19/greg-abbott-data-center-donors-texas/
2•DeepLogin•23m ago•0 comments

EFF Launches Privacy Badger for Safari on macOS

https://www.eff.org/deeplinks/2026/10/announcing-privacy-badger-safari-macos
2•DeepLogin•25m ago•0 comments

Mission blasts off for Mars to grab a piece of its moon

https://www.bbc.com/news/articles/cmvgxvkv54w1o
2•tagawa•26m ago•0 comments

Show HN: barn.app – a digital stream deck like agent monitoring tool for macOS

https://barn.ope.cool
1•TheGoodBarn•27m ago•0 comments

Richard Riehle, prolific actor from 'Office Space', dies at 78

https://www.yahoo.com/entertainment/celebrity/article/richard-riehle-prolific-character-actor-kno...
4•bigwheels•30m ago•3 comments

MLIR CodeGen Dialects for Machine Learning Compilers (2022)

https://www.lei.chat/posts/mlir-codegen-dialects-for-machine-learning-compilers/
1•peter_d_sherman•30m ago•1 comments

What happened to open weights models?

1•sparse-Matrix•31m ago•0 comments

A Russian satellite is stalking a U.S. spacecraft in orbit. Experts are worried

https://www.scientificamerican.com/article/alarm-grows-over-russian-satellites-provocative-approa...
3•tusslewake•32m ago•0 comments

Universal Basic AI

https://www.bloomberg.com/opinion/newsletters/2026-10-19/universal-basic-ai
1•ent101•33m ago•0 comments

Show HN: Open-source AAS digital twin studio with live PLC data collection

https://github.com/waceinc/vexplor-aas
1•effectsno1•34m ago•0 comments

Caching in Gemini 4 Argon has some quirks

https://www.induction.ai/blog/caching-in-gemini-4-argon
2•bleonard•38m ago•0 comments