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

Goto Considered Sick (for error handling in C)

https://thestateofinahaze.net/blog/c-goto-considered-totally-sick/
1•birdculture•34s ago•0 comments

How to Ace Interviews and Meetings with AI Assistance

https://sanityos.com/blog/ai-meeting-interview-assistant
1•bdilpreet66•4m ago•0 comments

Deep Learning Made Difficult

https://philsci-archive.pitt.edu/id/eprint/31028/
1•mathgenius•7m ago•0 comments

Herdr has released native app

https://github.com/herdrdev/herdr-app
1•cherioo•8m ago•0 comments

Sudo

https://sudo.com/
2•tianqi•12m ago•0 comments

Patrick Stewart Is Dead

https://www.facebook.com/story.php?story_fbid=1684958202998565&id=100044532035444&rdid=TakuwHXHD0...
1•thunderbong•14m ago•0 comments

Show HN: JSON to printable invoice CLI, zero deps, no sign-up

https://github.com/kleogeos/freelance-invoice-cli
1•kleogeos•14m ago•0 comments

Wenzhou Train Collision

https://en.wikipedia.org/wiki/Wenzhou_train_collision
2•tianqi•14m ago•0 comments

The Web Can't Afford a JavaScript Runtime Monoculture

https://redmonk.com/kholterhoff/2026/10/27/js-runtime-monoculture/
3•nnx•14m ago•0 comments

You can still get a IPv4 /24 from ARIN for $275⅌year, with strings attached

https://dreamstation.systems/personal/arin410.html
2•robinpie•16m ago•0 comments

Animations for System Builders: Metastability and Lost Writes

https://www.brooker.co.za/blog/2026/10/23/animations.html
1•pykello•18m ago•0 comments

Cormac McCarthy's Library

https://cormacmccarthy.lib.utk.edu/
2•maitland•19m ago•1 comments

Show HN: Cubic Doggo 07B Wouf: A low-cost open-source quadruped with ST3215

https://github.com/SphericalCowww/CubicDoggo_07B
2•SphericalCowww•21m ago•0 comments

Patrick Stewart dies at 86

https://www.reuters.com/world/uk/british-actor-patrick-stewart-has-died-his-family-says-2026-10-29/
5•rsyring•22m ago•2 comments

GitHub trending projects with bilingual AI reviews and MCP access

https://hotrepo.ai
1•AloneMonkey•25m ago•0 comments

HoneyComb Surfels for Edge 3D Rendering and Reconstruction

https://honeycomb-surfels.github.io/
2•3d_stuff•27m ago•0 comments

We are all voting for Stroll F1 Driver of the Day this Sunday

https://www.reddit.com/r/formula1/comments/1xj0wgq/we_are_all_voting_for_stroll_dotd_this_sunday_...
1•ashitlerferad•29m ago•0 comments

Using Vulkan on Wayland Without WSI

https://ptrtoliam.dev/blog/vkwayland/
1•ibobev•29m ago•0 comments

Virtual Shadow Maps

https://graphics-programming.org/blog/virtual-shadow-maps
1•ibobev•30m ago•0 comments

Paint That Squishes

https://danfountain.com/blog/paint-that-squishes/
1•ibobev•30m ago•0 comments

Show HN: I'm seriously concerned about this commenter's mental health

https://news.ycombinator.com/threads?id=aaron695
2•johnnyApplePRNG•33m ago•0 comments

Nodwyn – An Extensible Coding Harness

https://nodwyn.com/
1•fclaude•36m ago•0 comments

Josh Kushner's Thrive and OpenAI to buy home security firm ADT

https://www.ft.com/content/f88e30a0-1252-4695-97b0-03da22e5fd42
5•JumpCrisscross•40m ago•0 comments

The Factory in Phoenix That Could Save American Manufacturing

https://www.nytimes.com/2026/10/23/opinion/ai-computer-chips-semiconductor-arizona-industry.html
1•mooreds•41m ago•0 comments

Reed Hastings says Big Tech should get used to being hated – like Big Pharma

https://www.businessinsider.com/reed-hastings-big-tech-big-pharma-comparison-2026-10
2•ianand•41m ago•1 comments

Rich Hickey: "AI" is not a tool

https://gist.github.com/richhickey/a2e19ef3f6f69ca0cca617a8a0da2268
1•denysonique•44m ago•2 comments

Did your company donate to Trump's ballroom project? Call your lawyer

https://www.politico.com/news/2026/10/29/oversight-lobbying-k-street-01139772
3•JumpCrisscross•44m ago•0 comments

Read Books with Visuals ASAP

https://magichour.ai
1•aaron_dutta•44m ago•0 comments

Please Let the Internet Die

https://www.wired.com/story/let-the-internet-die/
1•SockThief•45m ago•1 comments

Meta discussed 'whisper strategy' against social media critic Jonathan Haidt

https://www.theguardian.com/technology/2026/oct/29/meta-staff-us-social-media-critic-jonathan-hai...
5•pseudolus•47m ago•0 comments