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

Verify hardware tasks without owning it

https://theoric.com/blog/building_virtual_hardware_for_real_performance/
1•abhishek4561•57s ago•1 comments

Historic Great Lakes Bulker Departs for Boneyard

https://maritime-executive.com/article/historic-great-lakes-bulker-set-to-depart-for-boneyard
1•hermitdev•10m ago•0 comments

One Connection Kills a Database

https://planetscale.com/blog/debugging-live-database-connections
2•fagnerbrack•17m ago•0 comments

Intel faced a choice: Give Trump 10% or face the consequences

https://www.wired.com/story/inside-trumps-demands-to-another-chips-ceo/
5•extasetoi12•18m ago•2 comments

Shopify Black Friday Cyber Monday

https://bfcm.shopify.com/
3•thecybernerd•23m ago•1 comments

Show HN: Omnistew – 3D multiplayer RTS inspired by Risk, playable in a browser

https://omnistew.io/
1•omnistew•23m ago•0 comments

3D Medical Viewer

https://github.com/ahmadmustafaanis/Medical-Viewer
1•ahmadanis1234•28m ago•0 comments

US Government bars bandwidth provider RETN from American networks

https://www.reuters.com/business/media-telecom/us-government-bars-bandwidth-provider-retn-america...
2•usernomdeguerre•29m ago•0 comments

Stigler Diet

https://en.wikipedia.org/wiki/Stigler_diet
4•wy35•32m ago•0 comments

Show HN: HardCall – Test 52ms raw RTP vs. 920ms WebSocket barge-in in browser

https://hardcall.statementflow.win
2•wangguode•35m ago•0 comments

Show HN: Plain-Auth an open-source authentication library for Go

https://github.com/Plain-Org/plain-auth
2•NabilSince•38m ago•0 comments

Science, startups and beer predict 92% of a country's HN readership

https://micjm.com/blog/hn-readership-science-startups-beer/
3•seizethecheese•39m ago•0 comments

Game-Changing Move Just Gave America the Edge over China in AI

https://www.wsj.com/tech/a-game-changing-move-just-gave-america-the-edge-over-china-in-ai-53492e2c
1•bookofjoe•40m ago•1 comments

Show HN: Far Worlds, a co-op voxel RPG that runs in the browser on WebGPU/WebRTC

https://farworlds.com/play
1•braydo25•42m ago•0 comments

Poland signs contract with Palantir worth $300M over 5 years

https://www.reuters.com/technology/poland-signs-contract-with-palantir-worth-300-mln-over-5-years...
3•danielam•46m ago•0 comments

Happy 60th Birthday to PDP-10, running ITS and Zork

https://hyperties.org/machine/games/zork/
3•DonHopkins•54m ago•1 comments

Discord: Important Policy Updates

https://discord.com/safety/important-policy-updates
2•marjipan200•55m ago•0 comments

Native Apple CarPlay running on iPhone or iPad. All in one device

https://github.com/DriveDeckApp/InstallDriveDeck
2•driftfire98•56m ago•0 comments

Scout – free Al agents that work while you're away

https://scoutcode.dev/
1•gentra•57m ago•2 comments

First Substack Post

https://substack.com/profile/134183441-avi-perera/note/c-398559756?utm_source=substack&utm_conten...
2•workwithavip•1h ago•0 comments

Show HN: A 52 KB WebAssembly engine that runs Qwen3.5-2B in a browser tab

https://tesseracted.com/experiments-llm-os/
3•kkm•1h ago•0 comments

They Bought Their Dream Home. Their Neighbors Want to Evict Them

https://www.nytimes.com/2026/11/26/world/europe/pasolini-house-eviction-court.html
2•Michelangelo11•1h ago•1 comments

Civet: TypeScript superset that favors more types and less typing

https://github.com/DanielXMoore/Civet
1•nateb2022•1h ago•0 comments

Manna (2003)

https://en.wikipedia.org/wiki/Manna_(novel)
7•simonebrunozzi•1h ago•1 comments

Flemish Media (DPG) & Broadcaster (VRT) Archives

https://hetarchief.be/en
1•gnabgib•1h ago•0 comments

OpenAI countersues Apple for stealing trade secrets

https://www.ft.com/content/af599e07-d44c-4068-ab84-6ee3c85551d4
5•mgh2•1h ago•0 comments

Named constants and supporting objects in C

https://gustedt.wordpress.com/2026/11/06/named-constants-and-supporting-objects-in-c/
1•ingve•1h ago•0 comments

Frontier agents are still unreliable at sustained goal-oriented work

https://twitter.com/lateinteraction/status/2126057001964704241
2•espeed•1h ago•0 comments

Today YouTube suspended my channel for "unsatisfying or off-putting content"

https://twitter.com/alscyborg/status/
2•fortran77•1h ago•0 comments

Google DeepMind's AI safety researcher: "I'm not optimistic"

https://twitter.com/alexmichael/status/2125976282303471643
3•doener•1h ago•0 comments