frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Ask HN: Help with doing statistics over machine code

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

Nerve pain drug gabapentin linked to increased dementia, cognitive impairment

https://medicalxpress.com/news/2025-07-nerve-pain-drug-gabapentin-linked.html
1•clumsysmurf•22s ago•0 comments

Netflix Tudum Architecture: From CQRS with Kafka to CQRS with Raw Hollow

https://netflixtechblog.com/netflix-tudum-architecture-from-cqrs-with-kafka-to-cqrs-with-raw-hollow-86d141b72e52
1•soheilpro•1m ago•0 comments

Budget limits at DHS delayed FEMA's Texas deployment

https://www.washingtonpost.com/climate-environment/2025/07/10/fema-texas-flooding-dhs-search-rescue/
1•KnuthIsGod•9m ago•0 comments

The first intelligent screenshot tool of the AI era

https://github.com/zhushen12580/smart-screenshot
2•zane12580•10m ago•0 comments

Hard Usernames for Games Generator

https://hardusernames.com/en/hard-usernames-for-games
1•labubulive•10m ago•0 comments

The Egos at id (Software)

https://www.marclaidlaw.com/the-egos-at-id/
1•neko_ranger•12m ago•0 comments

'Autofocus' specs promise sharp vision, near or far

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

Tool strips away anti-AI protections from digital art

https://www.technologyreview.com/2025/07/10/1119937/tool-strips-away-anti-ai-protections-from-digital-art/
1•gnabgib•16m ago•0 comments

A Poor Man's User Study with a Vision Model and E[P]

https://twitter.com/johnjhorton/status/1943473769219002766
1•john_horton•16m ago•0 comments

Extreme Low-Bit Clustering for Large Language Models via Knowledge Distillation

https://arxiv.org/abs/2506.12038
1•PaulHoule•21m ago•0 comments

Grok 4 seems to consult Elon Musk to answer controversial questions

https://techcrunch.com/2025/07/10/grok-4-seems-to-consult-elon-musk-to-answer-controversial-questions/
6•mkeeter•22m ago•0 comments

America's largest power grid is struggling to meet demand from AI

https://www.reuters.com/sustainability/boards-policy-regulation/americas-largest-power-grid-is-struggling-meet-demand-ai-2025-07-09/
1•qwikhost•22m ago•0 comments

Show HN: Open-Source Alternative to Mercury

https://github.com/different-ai/zero-finance
1•ben_talent•22m ago•0 comments

Psilocybin treatment extends cellular lifespan, improves survival of aged mice

https://www.nature.com/articles/s41514-025-00244-x
12•pseudolus•24m ago•1 comments

Supporting kernel development with large language models

https://lwn.net/Articles/1026558/
1•signa11•26m ago•0 comments

Flickle – connect any two actors via movies in ≤6 guesses

https://flickle.carpoolgames.net
4•kanoacook•26m ago•1 comments

Earth's Spin Picks Up Speed: 3 Shorter Days This Summer

https://esstnews.com/earths-spin-picks-up-speed-3/
1•thunderbong•28m ago•0 comments

Automating Weekly Releases with GitHub Actions

https://michaelbastos.com/?blog=automating-weekly-releases-with-github-actions
1•mbastos•31m ago•1 comments

Over 2,000 senior staff set to leave NASA under agency push

https://www.politico.com/news/2025/07/09/nasa-staff-departures-00444674?cdmc=2zglpgOF21PefXUKP0PbPaLZDC0&refcode2=2zglpgOF21PefXUKP0PbPaLZDC0&refcodecdmc=2zglpgOF21PefXUKP0PbPaLZDC0
8•belter•34m ago•1 comments

Anubis now supports non-JS challanges

https://anubis.techaro.lol/blog/release/v1.20.0/
1•todsacerdoti•35m ago•0 comments

A remembrance of Matthew S. Trout (mst)

https://curtispoe.org/blog/rip-mst.html
3•todsacerdoti•37m ago•0 comments

Some of Iran's Enriched Uranium Survived Attacks, Israeli Official Says

https://www.nytimes.com/2025/07/10/us/politics/iran-attacks-damage.html
2•whack•37m ago•1 comments

Bionic robot arm lets plants play musical instruments (2024)

https://djmag.com/news/bionic-robot-arm-lets-plants-play-musical-instruments
1•danboarder•39m ago•0 comments

Just Works

https://www.linuxmint.com/
1•babuloseo•40m ago•0 comments

Improved load balancing with machine learning

https://lwn.net/Articles/1027096/
1•signa11•40m ago•0 comments

Jai Demo and Design Explanation (Jonathan Blow) [video]

https://www.youtube.com/watch?v=IdpD5QIVOKQ
3•surprisetalk•44m ago•0 comments

1 in 3 US teens have prediabetes, new CDC data show

https://abcnews.go.com/Health/1-3-teens-prediabetes-new-cdc-data-shows/story?id=123591558
2•hilux•48m ago•0 comments

Major Aussie health company that employs 19,000 people COLLAPSES

https://www.msn.com/en-us/money/markets/major-aussie-health-company-that-employs-19000-people-collapses/ar-AA1FtmHn
2•KnuthIsGod•50m ago•1 comments

Photo agencies to boycott Oasis tour over rights restrictions

https://www.theguardian.com/music/2025/jul/10/photo-agencies-to-boycott-oasis-tour-rights-restrictions
1•stuartmemo•52m ago•0 comments

Grok: Searching X for "From:Elonmusk (Israel or Palestine or Hamas or Gaza)"

https://simonwillison.net/2025/Jul/11/grok-musk/
31•simonw•52m ago•18 comments