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

Russia orders non-state data centres to reserve 10% of capacity for Russia

https://www.reuters.com/technology/putin-orders-private-data-centres-set-aside-10-capacity-suppor...
1•giuliomagnifico•1m ago•0 comments

Ask HN: Now that Reddit blocks access, what will be replacing it?

1•dude250711•1m ago•0 comments

Sunscreen, a stylus, and 16 hours of pair programming with an AI

https://www.collabora.com/news-and-blog/blog/2026/11/02/sunscreen-a-stylus-and-16-hours-of-pair-p...
1•losgehts•3m ago•0 comments

Harari vs. Henrich. What science says about human evolution

https://josephheath.substack.com/p/harari-vs-henrich
1•tomgp•5m ago•0 comments

Apple has a touchscreen MacBook. Why now?

https://www.tomshardware.com/laptops/macbooks/apple-finally-has-a-touchscreen-macbook-why-now
1•rndsignals•6m ago•0 comments

Anthropic RSI recursive self improvement

https://www.wsj.com/tech/ai/ai-anthropic-rsi-recursive-self-improvement-bff4e815
1•rdudekul•6m ago•0 comments

We replaced 11,000 lines of AI chat code with CopilotKit and AG-UI

https://fynk.com/en/blog/fynk-assistant-copilotkit-vue/
3•0cool•7m ago•0 comments

Show HN: aido – Spec-driven, test-driven engineering workflow for Claude Code

https://github.com/joebew42/aido
1•joebew42•7m ago•0 comments

StepForge – Turn your clicks into step-by-step guides

https://github.com/Twest2/StepForge
1•twest39•7m ago•0 comments

Let Me Ch...

https://blog.alxgsv.com/let-me-check/
1•alxgsv•8m ago•0 comments

I Read the Clankers' Code

https://fev.al/posts/i-read-the-code/
1•charles_f•9m ago•0 comments

OpenHaven: P2P/decentralized-web protocol and tool discovery

https://openhaven.net/
1•akagusu•11m ago•0 comments

Convex, but agent native and no vendor lock in

https://www.getfeltkit.com/
1•rkendel•12m ago•0 comments

20-Year-Old Nathalia Filgueiras Was a Pilot on Learjet That Crashed in Florida

https://www.nytimes.com/2026/11/02/us/nathalia-filgueiras-florida-plane-crash-pilot.html
1•gmays•12m ago•0 comments

DHH Spends 900 Hours Cutting Omarchy Boot Time by 0.4 Seconds

https://bloatberg.com/2026/11/02/dhh-spends-900-hours-cutting-omarchy-boot-time-by-0-4-seconds-wi...
2•akagusu•12m ago•0 comments

Show HN: Garrul – Comments system for your site on a single Cloudflare Worker

https://github.com/KingPin/Garrul
1•KingPinX•13m ago•0 comments

Which functions a C++ call can see

https://train-it.eu/blog/which-functions-a-call-can-see/
1•ibobev•13m ago•0 comments

Geolocation leak using plane doppler curves [video]

https://www.youtube.com/watch?v=UytYrhYLOKI
2•flicker-rate•15m ago•0 comments

Show HN: Relaynet – open-source relay that gives browser tabs a real network

https://github.com/beriberikix/relaynet
1•jonathanberi•15m ago•0 comments

Beating the compiler at signed 32-bit division

https://lemire.me/blog/2026/10/31/beating-the-compiler-at-signed-32-bit-division/
1•ibobev•15m ago•0 comments

Activists create 'boulder barrier' in North Sea to deter industrial fishing

https://www.theguardian.com/environment/2026/nov/02/greenpeace-boulder-barrier-north-sea-industri...
2•mo7061•15m ago•0 comments

Inktober 2026

https://ratfactor.com/inktober26/
1•ibobev•15m ago•0 comments

Google search has gone from being handy to useless

https://www.theguardian.com/commentisfree/picture/2026/nov/02/google-search-has-gone-from-being-v...
2•mrkn1•16m ago•0 comments

Apple warns users in 99 countries of mercenary spyware

https://therecord.media/apple-warns-users-99-countries-mercenary-spyware
1•acossta•16m ago•0 comments

How Well Do Agents Perform on DevOps Tasks?

https://cloudopsbench.ai/blog/failure-taxonomy
1•matt_d•16m ago•0 comments

The Crisis in Poland

https://www.craigmurray.org.uk/archives/2026/11/the-crisis-in-poland/
2•Georgelemental•17m ago•0 comments

United Airlines Flight 232

https://en.wikipedia.org/wiki/United_Airlines_Flight_232
1•LolWolf•17m ago•0 comments

Show HN: Build and explore a shared AI computer, just by talking

https://duplex.party/
1•SebastianSosa•17m ago•0 comments

Idaho Official State Gun Question Election 2026

https://ballotpedia.org/Idaho_Official_State_Gun_Question_(2026)
1•kyleblarson•18m ago•0 comments

Economists studied California's billionaire tax, reached different conclusions

https://text.npr.org/g-s1-151009
2•mooreds•18m ago•2 comments