frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Three matrix algorithms, three walk orders – interactive animations

https://algo-rhythm.dev/en/matrix/
1•bytego•34s ago•0 comments

Wolfram Language

https://www.wolfram.com/language/
1•maxall4•4m ago•0 comments

It's Time to Walk

https://www.inferterra.com/the-new-workspace-a-first-principles-exploration-of-dictation-agents-a...
1•matt_teresi•5m ago•0 comments

Guesstimate

https://en.wikipedia.org/wiki/Guesstimate
1•teleforce•7m ago•0 comments

NVSX: Adopt NVSentinel the Easy Way

https://github.com/nav-beep/nvsx
1•essekar•9m ago•0 comments

SpaceX announced Starship flyby of Mars

https://twitter.com/SPACEdotcom/status/2057603078711394402
1•decimalenough•10m ago•0 comments

AI Slop and the Vulnerability Treadmill

https://redmonk.com/kholterhoff/2026/05/05/ai-slop-vulnerability-treadmill/
1•mooreds•15m ago•0 comments

Read Meta's Layoff Email to Employees

https://www.businessinsider.com/read-meta-layoff-email-employees-2026-5
3•mooreds•15m ago•1 comments

The AI-Native Interview

https://sierra.ai/blog/the-ai-native-interview
1•mooreds•15m ago•0 comments

DApp Inspector – DevTools Panel for Web3 RPC Traffic

https://github.com/beilunyang/dapp-inspector-extension
1•beilunyang•17m ago•0 comments

Show HN: Deputies, an open source background agent

https://deputies.dev/
1•spalas•21m ago•0 comments

Samsung chip workers will get an average $340k bonus as AI profits soar

https://qz.com/samsung-chip-workers-bonus-ai-profits-052126
7•carabiner•25m ago•1 comments

Iran Moved Billions Through Binance to Fund Regime–Continuing into This Month

https://www.wsj.com/world/middle-east/iran-binance-crypto-military-e755b218
11•JumpCrisscross•28m ago•0 comments

Title: Tax season felt chaotic at my accounting firm, so I built this

https://taxassembly.com/
2•jaychooo•29m ago•2 comments

Why does it look like LLMs consistently overestimate implementation time?

1•bridgettegraham•29m ago•0 comments

Crypto and AI-Funded Super PACs Are Metastasizing

https://www.thenation.com/article/politics/crypto-ai-super-pacs-election-spending-big-tech-dark-m...
1•petethomas•38m ago•0 comments

'Broadview Six' defendants have all remaining charges dismissed

https://www.nbcchicago.com/news/local/chicago-politics/broadview-six-defendants-have-all-remainin...
2•petethomas•40m ago•0 comments

Consumer groups file complaint against Meta, TikTok and Google running scam ads

https://www.beuc.eu/press-releases/consumer-groups-file-complaints-against-meta-tiktok-and-google...
3•benoau•40m ago•0 comments

Merkel Urges EU to Keep Regulating Social Media Speech

https://reclaimthenet.org/merkel-eu-speech-regulation-censorship
1•Cider9986•41m ago•0 comments

Homemade robot fluff ball with a realistic eye

https://www.instagram.com/reel/DYnsNwlzxG5/
1•authorisedfrog•41m ago•0 comments

The AI Bubble – No One's Happy

https://nooneshappy.com/article/the-ai-bubble/
5•diebillionaires•46m ago•3 comments

FCC Extends Update Deadline for Foreign-Made Routers, Drones Until 2029

https://www.pcmag.com/news/fcc-extends-update-deadline-for-foreign-made-routers-drones-until-2029
1•gnabgib•47m ago•0 comments

Convert between 30 color formats in one tool (HEX, RGB, Tailwind, Flutter, etc)

https://colorcx.com/
1•hkdb•49m ago•0 comments

How you probably will find Satoshi

https://foxchapelresearch.substack.com/p/how-you-probably-will-find-satoshi
7•lalaland1125•50m ago•0 comments

Condé Nast expects search to become a single-digit of its traffic

https://searchengineland.com/conde-nast-search-single-digit-traffic-477358
2•gnabgib•55m ago•0 comments

Fork Your Dependencies

https://twitter.com/mitchellh/status/2057171518027887035
4•nreece•1h ago•0 comments

Stocks Are Not an Effective Inflation Hedge

https://financialpost.com/pmn/business-pmn/repeat-after-me-stocks-are-not-an-effective-inflation-...
2•littlexsparkee•1h ago•0 comments

The Rise of Build-to-Rent Housing

https://www.construction-physics.com/p/the-rise-of-build-to-rent-housing
2•JumpCrisscross•1h ago•0 comments

Trump's IRS "settlement" is not limited to $1.776B [video]

https://www.youtube.com/watch?v=tIBCjzz-bmk
1•mdnahas•1h ago•1 comments

Woman files lawsuit after arrest for Facebook post concerning Trinidad water

https://www.fox4news.com/news/woman-arrested-facebook-post-concerning-trinidad-water-poisoning
2•ki4jgt•1h ago•0 comments