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

Prepaid Cellphone Plans – Comparison Site

https://prepaidcompare.net
1•WarOnPrivacy•3m ago•1 comments

CannonSmash-Web

https://github.com/jgbrwn/cannonsmash-web
1•indigodaddy•3m ago•0 comments

Show HN: Ilya Sutskever's AI reading list into a learning RPG – using kimi k3

https://ilya-papers-quest.naigap.com/#/
1•praveer13•6m ago•0 comments

A free PTE Core practice platform with instant AI scoring

https://ptecorepractice.com
1•justinzhou01•6m ago•1 comments

Retrotvs – Channel-surf the past now by choosing any of the TV sets

https://70s.myretrotvs.com/
1•modinfo•6m ago•0 comments

On Ethics and Usefulness

https://manuelmoreale.com/thoughts/on-ethics-and-usefulness
1•HotGarbage•9m ago•0 comments

New hybrid positioning system promises reliable tracking where GPS fails

https://www.qmul.ac.uk/news/latest-news/2026/science-and-engineering/se/new-hybrid-positioning-sy...
1•hhs•18m ago•0 comments

Multi-Agent LLMs Fail to Explore Each Other

https://arxiv.org/abs/2607.11250
1•Anon84•20m ago•1 comments

Statistical test helps judge the value of personalization

https://news.stanford.edu/stories/2026/07/statistical-test-personalization-k-fold
1•hhs•21m ago•0 comments

Java was a three-day hotfix away from dying horribly on stage

https://www.theregister.com/devops/2026/07/18/java-was-a-three-day-hotfix-away-from-dying-horribl...
1•jnord•21m ago•0 comments

The headache of hospital pricing

https://lawliberty.org/the-headache-of-hospital-pricing/
1•hhs•23m ago•0 comments

The 3:47 Am Wake‑Up Call That Changed Everything

https://hackenewhome.blogspot.com/p/code-optimise-pour-blogger-suppression.html
1•AllForAll•25m ago•0 comments

Juggling for Blind People

https://www.jugglingforblindpeople.com/
3•pipnonsense•26m ago•0 comments

Even Microsoft couldn't make Windows 11 work well on 8GB of RAM

https://www.theverge.com/tech/966937/microsoft-surface-laptop-13-inch-8gb-ram-2026-review
2•GeekyBear•29m ago•1 comments

Welcome to Toronto, World Capital of the Urban Raccoon

https://lithub.com/welcome-to-toronto-world-capital-of-the-urban-raccoon/
2•herbertl•31m ago•0 comments

HN: Save Replay – Trim a video before uploading it

https://savereplay.com
2•IGOLz•31m ago•0 comments

Don't Force the Money Too Early

https://nik.art/dont-force-the-money-too-early/
2•herbertl•33m ago•0 comments

Prompted to Start: How Generative AI Is Transforming Entrepreneurship [pdf]

https://conference.nber.org/conf_papers/f238865.pdf
2•herbertl•35m ago•0 comments

SafeAI – Open-Source Static AI Risk Analyzer for AI Agents

https://github.com/ikaruscareer/SafeAI
2•ikaruscareer•35m ago•0 comments

How Indian Railways plans to stop blanket, bedsheet theft on trains

https://www.moneycontrol.com/europe/?url=https://www.moneycontrol.com/news/india/how-indian-railw...
2•rustoo•36m ago•0 comments

Hiring Private equity firm doing 9M in revenue

https://www.careerjumpship.com/jobs/fullstack-engineer-cofounder-nyc-b84627f7
2•jaredzwick•39m ago•0 comments

Gap in Mochizuki's proof of ABC confirmed by Lean

https://twitter.com/FumiharuKato/status/2078017230537892207
3•ogogmad•40m ago•0 comments

Can you build a five that beats the 73-9 Warriors?

https://www.73-9-game.com/
2•jeyzolo•45m ago•1 comments

Mayor Mamdani Says Landlords Can't Use AI Images to Advertise

https://petapixel.com/2026/07/16/mayor-mamdani-says-landlords-cant-secretly-use-ai-images-to-adve...
29•gnabgib•46m ago•11 comments

The Professor Who Taught People How to Think (1962) [video]

https://www.youtube.com/watch?v=rBN5SWCReJQ
2•kklisura•48m ago•0 comments

AI Mania Is Eviscerating Global Decision-Making

https://hermit-tech.com/blog/ai-mania-is-eviscerating-global-decisionmaking
6•frizlab•49m ago•0 comments

Real-Time LuaTeX: Recompiling Large Documents in 1ms [pdf]

https://www.tug.org/tug2026/preprints/lode-realtime.pdf
7•amichail•51m ago•1 comments

Show HN: RewindCup – explore 23 World Cups on an interactive globe

https://rewindcup.com
2•iamdavidoti•53m ago•0 comments

curl can be used to send emails with SMTP

https://mastodon.social/@chr1stian/116924759058231144
6•21sys•54m ago•0 comments

Roger Summit, Early Search Pioneer, Dies at 95

https://www.nytimes.com/2026/07/17/technology/roger-summit-dead.html
2•furytrader•55m ago•0 comments