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

Manually Creating a ZFS Pool from Mismatched Drives

https://www.naturalborncoder.com/2024/07/manually-creating-a-zfs-pool-from-mismatched-drives/
1•todsacerdoti•1m ago•0 comments

Agent Enabled Marketplace

https://artificialbanking.app/
1•momoexpress•1m ago•0 comments

Ether: The AI operating system organizations run on

https://www.ether.dev/
1•wawhal•1m ago•0 comments

Some Thoughts on the Markdown Web

https://lmika.org/2026/11/30/some-thoughts-on-the-markdown.html
1•speckx•2m ago•0 comments

Thoughts on "Super Mario Bros. On a QR Code"

https://sethmlarson.dev/smb-to-qr-code
1•titusblair•3m ago•0 comments

Show HN: PTX Puzzles – 12 real GPU sync bugs to fix, graded by a race detector

https://github.com/ShreshthRajan/ptx-puzzles
1•shreshthrajan•4m ago•0 comments

NYT Sunsets APIs

https://bsky.app/profile/mellymeldubs.bsky.social/post/3n3ph374gas2x
1•jaredwiener•5m ago•0 comments

It feels that there's an oddly missing pole standing for affirmative postures

https://twitter.com/patrickc/status/2128203058144550919
1•jger15•5m ago•0 comments

Flock to Layoff More Than Quarter of Staff After Company's Most Challenging Year

https://www.404media.co/flock-to-layoff-more-than-a-quarter-of-staff-after-the-companys-most-chal...
1•beardyw•6m ago•0 comments

Xerox printers' QR codes send UK users to Chinese porn

https://arstechnica.com/gadgets/2026/12/xerox-printers-qr-codes-send-uk-users-to-chinese-porn/
4•duxup•6m ago•0 comments

Pareto Frontiers for Everyday Decisions

https://paretoparty.com
1•maitland•6m ago•0 comments

Vector Lakebase Architecture GA

https://zilliz.com/blog/zilliz-vector-lakebase-generally-available
1•Fendy•7m ago•0 comments

Intuit Enters Agreement to Sell Mailchimp

https://mailchimp.com/newsroom/intuit-mailchimp-bendingspoons/
3•latchkey•10m ago•0 comments

Meta's Muse Charm will cost $299 as company tests if consumers want AI hardware

https://www.cnbc.com/2026/12/01/meta-muse-charm-ai-agent-hardware.html
2•gmays•10m ago•0 comments

Belgian scientists use AI to make alcohol-free beer taste more like beer

https://english.elpais.com/science-tech/2026-12-02/belgian-scientists-use-ai-to-make-alcohol-free...
2•dxs•11m ago•0 comments

Cookie Monster Tries to Meet His A.I. Mandate

https://www.newyorker.com/magazine/2026/10/05/cookie-monster-tries-to-meet-his-ai-mandate
2•CharlesW•12m ago•0 comments

Silicon Valley's Spying Problem Goes Beyond Nvidia

https://www.nytimes.com/2026/12/02/business/silicon-valley-spying-ai-nvidia.html
2•awad•14m ago•0 comments

Software is dead, personalized software is not

https://www.staycaffeinated.com/2026/12/02/software-is-dead-personalized-software-is-not
2•frenchie4111•15m ago•0 comments

Tencent, Alibaba, ByteDance shift Nvidia budget to domestic chips after US curbs

https://www.reuters.com/business/retail-consumer/tencent-alibaba-bytedance-shift-nvidia-budgets-d...
6•yogthos•16m ago•0 comments

Tracing LLM lineage using their weights

https://matthewritch.com/blog/2026/12/01/Spanner-LLM-Lineage/
2•mdritch•20m ago•0 comments

Ford alerts 700000 SUV owners of carbon monoxide poisoning risk after 2 deaths

https://www.cnn.com/2026/12/02/business/ford-suvs-carbon-monoxide-risk
6•l2silver•20m ago•0 comments

At 100, Dick van Dyke Credits His Longevity to One Habit

https://www.sciencealert.com/at-100-dick-van-dyke-credits-his-longevity-to-one-habit-and-science-...
3•cybermango•20m ago•0 comments

The machine breakers – Eric Hobsbawm

https://libcom.org/article/machine-breakers-eric-hobsbawm
2•oriettaxx•20m ago•0 comments

Pentagon says China recently tested space weapon in Earth's orbit

https://www.theguardian.com/world/2026/dec/02/china-space-weapons-test-pentagon-trump
3•WaitWaitWha•22m ago•0 comments

NCSC advises urgent action on migration to post-quantum cryptography

https://www.ncsc.gov.uk/news/ncsc-advises-urgent-action-on-migration-to-post-quantum-cryptography
2•testemailfordg2•23m ago•1 comments

AI-assisted indie game made $1.3M on Steam in one week

https://www.gamesradar.com/games/roguelike/a-solo-developers-first-game-made-usd1-3-million-on-st...
4•lackoftactics•24m ago•0 comments

You can stop paying for SuperWhisper and WisprFlow Now

https://angadh.com/b/3n75ksrsvmn7hwtdjmr44zqbtj
2•angadhn•24m ago•0 comments

Laravel Rust

https://github.com/laravel/rust
4•mike1o1•25m ago•0 comments

Knotless private Git on ATProto spaces

https://knotless.dev/docs/guide/private/
3•jcbhmr•25m ago•0 comments

Ford alerts 700k SUV owners of carbon monoxide poisoning risk after 2 deaths

https://www.nhtsa.gov/press-releases/ford-recall-carbon-monoxide-risk
2•DeepLogin•25m ago•0 comments