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

Can Printed 'Skin' Heal Burns and Prevent Scars?

https://www.smithsonianmag.com/innovation/can-printed-skin-heal-burns-and-prevent-scars-180989000/
1•bookofjoe•42s ago•0 comments

An interactive chess social platform (first launch)

https://chesswire.app
1•hardikvora•54s ago•1 comments

Show HN: Clockclear – 12 ephemeral tools that auto-delete

https://us.clockclear.com/
1•annrap1d•3m ago•0 comments

Disposable Chat System

https://nonconfirmed.com/app/chatza/
1•colenikol2•4m ago•0 comments

Solar outproduced coal in April but not on the grid

https://arstechnica.com/science/2026/06/solar-outproduced-coal-in-april-but-not-on-the-grid/
1•Bender•6m ago•0 comments

Perform DFU Restores on Apple Silicon Macs with Macvdmtool (2021)

https://www.bkurtz.io/posts/macvdmtool/
1•gregsadetsky•6m ago•0 comments

Suffocating mega heat dome to engulf 35 states as forecasters issue urgent alert

https://www.dailymail.com/sciencetech/article-15938463/mega-heat-dome-weather-alert.html
1•Bender•7m ago•0 comments

Supreme Court expands Trump's power over the federal bureaucracy

https://www.washingtonpost.com/politics/2026/06/29/supreme-court-expands-trumps-power-over-federa...
1•throw0101a•11m ago•2 comments

Comparison Between ATProto and Tim Berners-Lee's Solid Protocol

https://forum.solidproject.org/t/comparing-solid-to-atproto-pds/9461
1•xeonmc•12m ago•0 comments

Small Penetrator Instrument Concept for the Advancement of Lunar Surface Science

https://iopscience.iop.org/article/10.3847/PSJ/abda4f
1•rbanffy•12m ago•0 comments

Learn X in Y Minutes

https://learnxinyminutes.com/
1•skogstokig•15m ago•0 comments

Show HN: Turn documents into lip-synced video readers

https://shashekhar.github.io/screencastgen/demo-reader/
2•ShaShekhar•15m ago•0 comments

LinkedIn without lunatics is deeply weird

https://designcapitalpower.substack.com/p/linkedin-without-lunatics-is-deeply
3•domstatecraft•18m ago•1 comments

About the security content of iOS 26.5.2 and iPadOS 26.5.2

https://support.apple.com/en-us/127594
1•akyuu•18m ago•0 comments

Open-sourcing Revolut's talent system: How we built Europe's top tech company

https://twitter.com/Revolut/status/2071623149955805247
2•rzk•21m ago•0 comments

Title: Show HN: 10 Killer Game Apps – O(1) hash-table lookup for game logic

https://big.lain.technology/gameapps/
1•glyph_os•23m ago•1 comments

California Leaders Agree to $351B Budget, Software Tax

https://www.bloomberg.com/news/articles/2026-06-27/california-leaders-agree-to-351-billion-budget...
3•rndsignals•25m ago•0 comments

The (real) dead economy theory

https://pluralistic.net/2026/06/17/its-the-stupid-economy-stupid/#trillionairitis
1•momentmaker•25m ago•0 comments

Show HN: Entity Event Matrix on any topic

https://reloadium.com/reloadium-investigations/
1•julienreszka•27m ago•0 comments

Show Up in Person 8:30 Am Tuesday in Sacramento to Save 3D Printing [video]

https://www.youtube.com/watch?v=vSU6QZO_rHM
1•jshprentz•28m ago•0 comments

Evals: The strategic IP that will define the next era of AI

https://twitter.com/GarrettLord/status/2068754262440767500
2•gmays•28m ago•1 comments

Segmenting Robot Video into Actionable Subtasks

https://macrodata.co/blog/annotating-robot-video-subtasks
1•tomaspduarte•32m ago•0 comments

A.I. 'Employees' Might Disrupt Work in Unexpected Ways

https://www.nytimes.com/2026/06/29/business/artificial-intelligence-workplace-consequences.html
4•speckx•34m ago•0 comments

Announcing .self: A New Top-Level Domain Designed to Support Self-Hosting

https://hccf.onmy.cloud/2026/06/21/reclaiming-our-digital-selves-hccfs-vision-for-a-human-centere...
6•HumanCCF•35m ago•3 comments

How the first solo-founder unicorn gets built

https://www.thisandthat.chat/blog/how-the-first-solo-founder-unicorn-gets-built/
1•jreynar•36m ago•1 comments

The Richest Country Is Pretty Mid Now [Benn Jordan][video]

https://www.youtube.com/watch?v=4FZy1lBNykA
6•onemoresoop•38m ago•0 comments

Video compression takes advantage of your eyes

http://stefano.petrilli.xyz/how-video-compression-takes-advantage-of-your-eyes/
2•stefanopetrilli•41m ago•0 comments

Zero Mostel's Testimony Before the Committee on Un-American Activities

https://www.nypl.org/events/exhibitions/galleries/literature-and-film/item/17519
1•kayo_20211030•42m ago•1 comments

Asymmetric Quantization: Near-Lossless Retrieval with 97% Storage Reduction

https://www.mixedbread.com/blog/asymmetric-quant
1•breadislove•43m ago•0 comments

Microsoft worker emails colleagues about company's support for genocidal Israel

https://www.thecanary.co/global/world-analysis/2026/06/26/microsoft-worker-emails/
12•DeusExMachina•43m ago•0 comments