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

Different Types of Tubes for River Tubing (2023)

https://www.riverbendfloats.com/types-of-river-tubes
1•mooreds•1m ago•0 comments

Meta Is Charging a Subscription for Smart Glasses Features

https://www.wired.com/story/why-meta-is-charging-a-subscription-for-on-device-smart-glasses-featu...
1•1vuio0pswjnm7•3m ago•0 comments

These are real people [video][22 mins]

https://www.youtube.com/watch?v=VFLSNxCLwCw
1•Bender•3m ago•0 comments

The Growing Compute Shortage [pdf]

https://www.apollo.com/content/dam/apolloaem/documents/insights/the-growing-compute-shortage.pdf
1•akyuu•6m ago•0 comments

Platform Engineering 2.0: Manage AI Costs and Risks Without Rebuilding

https://platformengineering.com/features/platform-engineering-2-0-manage-ai-costs-and-risks-witho...
2•CrankyBear•7m ago•0 comments

Show HN: MotionLoom – An open-source video-as-code language for video creation

https://lovelyzombieyho.github.io/anica-landing-page/motionloom/
1•LOVELYZOMBIEYHO•7m ago•0 comments

Screen Time for Under-2s Poses Long-Term Health Risks

https://www.verity.news/story/2026/screen-time-under-age-poses-longterm-health-risks
1•theanonymousone•7m ago•0 comments

At Dog School, children gain a sense of achievement

https://www.csmonitor.com/Perspectives/Making-a-difference/2026/0630/dog-school-south-africa-fund...
1•Tomte•8m ago•0 comments

Newsletters in 2026: $10 per month is default price

https://pressgazette.co.uk/newsletters/newsletters-2026-prices-retention-churn/
1•Tomte•8m ago•0 comments

Fixing "Tool Amnesia" in Model Context Protocol Ecosystems

https://pub.towardsai.net/fixing-tool-amnesia-in-model-context-protocol-ecosystems-c3fa03c90704
1•prachipanditrao•11m ago•0 comments

A Tale of Two Modems

https://daringfireball.net/2026/07/a_tale_of_two_modems
1•dabinat•12m ago•0 comments

Ask HN: Living alone to become illegal as intelligent robots could be required?

1•amichail•13m ago•0 comments

Symbolics.com – Oldest.com Domain

https://www.symbolics.com/
1•caminanteblanco•13m ago•0 comments

After almost a decade,Tesla Roadstar does not have a release date, all fraud?

https://www.tesla.com/roadster
1•kingleopold•13m ago•1 comments

Capture One adds support for Hasselblad cameras

https://www.captureone.com/en/hasselblad
1•emanuelez•14m ago•0 comments

Scientists propose launching giant 'airbag' into space to protect Earth

https://www.dailymail.com/sciencetech/article-15947451/giant-airbag-space-Earth-solar-superstorms...
1•Bender•16m ago•0 comments

The door out of Tapeout Hell

https://essenceia.github.io/projects/tapeout_tradition/
1•random__duck•17m ago•1 comments

Show HN: Claude skills to make anti-AI slop UI

https://github.com/Vinayak-Shukla-03/anti-ai-slop
3•vinayak-shukla•18m ago•2 comments

Box3D on Web

https://box3d-7rh.pages.dev/
1•mehmetoguzderin•19m ago•3 comments

Proving the fundamental theorem of arithmetic in Agda

https://byorgey.github.io/blog/posts/2026/06/26/FTA.lagda.html
1•fanf2•19m ago•0 comments

Show HN: Spotilyrics – See synchronized Spotify lyrics inside your editor

https://open-vsx.org/extension/therepanic/spotilyrics
1•therepanic•21m ago•0 comments

The Guide to the Best FDM 3D Printers of 2026

https://bambu3design.com/the-ultimate-guide-to-the-best-3d-printers-of-2026/
1•ehsanamel•21m ago•0 comments

New humanoid robots from China look like creepy pop star action figures

https://www.theregister.com/ai-and-ml/2026/07/02/new-humanoid-robots-from-china-look-like-creepy-...
2•Bender•21m ago•0 comments

Any guesses about BS short name after FAANG, ZIRP and MAG7?

1•kingleopold•22m ago•1 comments

FAA proposal: Supersonic airliners can fly over US cities if they're quiet

https://arstechnica.com/gadgets/2026/07/faa-proposal-supersonic-airliners-can-fly-over-us-cities-...
1•Bender•22m ago•0 comments

Ovaries Might Take on an Immune Function After Menopause

https://nautil.us/ovaries-might-take-on-an-immune-function-after-menopause-1282410
1•Brajeshwar•23m ago•0 comments

Japan APPI AI Training Exception Clears Lower House

https://techjacksolutions.com/ai-brief/japan-appi-ai-training-exception-clears-lower-house-what-com/
1•totetsu•24m ago•0 comments

Show HN: Muxer – open-source model multiplexer for Claude Code

https://github.com/DangerousYams/muxer
2•DangerousYams•24m ago•0 comments

How to play Doom online in Proton Drive

https://proton.me/support/play-doom-online
1•akyuu•26m ago•0 comments

Show HN: Fli – 18KB CLI file listing tool in no_std rust and Libc

https://github.com/tracyspacy/fli
3•yulkor•27m ago•0 comments