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

From Rent to Root: Introducing NvRoot

https://stealthium.io/blog/nvroot
1•sshah03•11s ago•0 comments

Discontinuation of Google and Apple Accounts Linking to Nintendo Accounts

https://www.nintendo.com/au/support/articles/discontinuation-of-google-and-apple-accounts-linking...
1•layer8•21s ago•0 comments

The ENIAC in Context: 80 Years of Computing History (VCF Midwest Talk) [video]

https://www.youtube.com/watch?v=4wm780EI6f4
1•fortran77•27s ago•0 comments

Guidelines on attempts to manipulate the ocean put spotlight on geoengineering

https://www.theguardian.com/environment/2026/nov/12/canada-climate-geoengineering-marine-carbon-c...
1•PaulHoule•1m ago•0 comments

The DO's and DOn'ts of Post-Quantum DNSSEC

https://ispcol.potaroo.net/2026-11/dodnssec.html
1•caminanteblanco•1m ago•0 comments

Trump says Apple's Tim Cook should take over Nvidia

https://www.washingtonpost.com/technology/2026/11/12/trump-says-apples-tim-cook-should-take-over-...
1•glass1122•3m ago•0 comments

"Omarchy ... v3 –> v4 migration just deleted my network setup without warning"

https://twitter.com/tomhacks/status/2120456892665450846
1•eatonphil•3m ago•1 comments

OpenAI and Georgia county leaders hit with Mafia-style RICO racketeering lawsuit

https://www.tomshardware.com/tech-industry/data-centers/georgia-politicians-openai-slapped-with-r...
1•myleshenderson•5m ago•0 comments

Show HN: DBZ Creator's studio demolished today. I rebuilt it in 3D

https://bird.jacomakes.com
1•jacomakes•6m ago•0 comments

R2: The Engine of Engines

https://www.redpanda.com/blog/r2-the-engine-of-engines
1•PeterCorless•6m ago•0 comments

2FA Removed from Humble Bundle

https://www.reddit.com/r/humblebundles/comments/1xtj3nj/2fa_removed_from_humble_bundle/
1•pavel_lishin•7m ago•2 comments

Show HN: ReadyStack.dev – Bit-for-bit reproducible OSS containers

1•readystack•8m ago•0 comments

Show HN: Jigsaw – modern multiplayer jigsaw puzzles in the browser

https://jigsaw.marnil.dev
1•mebn•9m ago•0 comments

Algorithm in the Consulting Room

https://medium.com/@smoking2man/algorithm-in-the-consulting-room-on-the-architectural-mismatch-be...
1•Aldus551•10m ago•0 comments

The Conflict Between Generative Art and AI

https://lostpixels.io/writings/the-ai-and-generative-art-conflict
1•cosiiine•11m ago•0 comments

Proschi – architecture diagrams as code that simulate load and failures

https://proschi.app/
1•gvart•11m ago•0 comments

Show HN: Dino Battle, a math adventure game my 7-year-old dreamed up

https://dinosaurs.flatown.com/
1•jflatow•12m ago•0 comments

Ontario SMR Nuclear Projects Face Delays and Overruns

https://www.nucnet.org/news/opg-begins-comprehensive-assessment-as-canada-smr-project-faces-delay...
1•pfdietz•12m ago•0 comments

Umo – Your AI CMO

https://www.umo.ai/
1•sahil_chaudhary•13m ago•0 comments

MIT engineers create a system for building shape-changing smart devices

https://news.mit.edu/2026/mit-engineers-create-system-for-building-shape-changing-smart-devices-0827
1•gmays•15m ago•0 comments

A friend recently prompted his own Linux ABI-compatible OS

https://twitter.com/patrickc/status/2120907937627684940
1•tosh•16m ago•0 comments

Apify Security Breach

https://status.apify.com
4•pupppet•17m ago•1 comments

macOS on Xiaomi Pad 6S

https://www.reddit.com/r/hackintosh/comments/1xuaton/updates_on_macos_for_xiaomi_pad_6s_pro/
1•jeswin•18m ago•0 comments

The Temperamental Nature of Alligator Gender-Reveal Parties

https://nautil.us/the-temperamental-nature-of-alligator-gender-reveal-parties-1286547
2•rbanffy•22m ago•0 comments

SwiftNIO: Why ByteBuffer Has Two Cursors

https://ivantokar.com/posts/swiftnio-why-bytebuffer-has-two-cursors/
1•frizlab•24m ago•0 comments

Show HN: Armin – Modern Anki alternative with prerrequisite graphs

https://armincards.app/
1•ansanabria•24m ago•0 comments

Amazon's Ring debuts security robots, including a drone

https://www.nbcnews.com/tech/tech-news/amazons-ring-debuts-security-robots-drone-rcna608538
1•gmays•25m ago•0 comments

Nera – Erlang that ships like Go

https://www.process-one.net/blog/nera-erlang-that-ships-like-go/
1•mremond•26m ago•0 comments

Who Is Colette Kress? Meet Nvidia's New Interim CEO

https://www.wsj.com/tech/colette-kress-nvidia-interim-ceo-ff26ef3a
2•pretext•26m ago•0 comments

Show HN: Lumin – Logs, metrics and uptime checks for one-person SaaS

https://getlumin.dev/
1•frederikmartin•27m ago•0 comments