frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Meet the Sad Wives of AI

https://www.wired.com/story/meet-the-sad-wives-of-ai/
1•pypt•1m ago•1 comments

Are We XLibre Yet? · X11Libre/Xserver Wiki

https://github.com/X11Libre/xserver/wiki/Are-We-XLibre-Yet%3F
1•xbmcuser•1m ago•0 comments

Six Million Selections Later: How the DMA Is Giving People Browser Choice

https://blog.mozilla.org/netpolicy/2026/05/11/six-million-selections-later-how-the-dma-is-giving-...
2•naves•6m ago•0 comments

Making Deep Learning Go Brrrr from First Principles

https://horace.io/brrr_intro.html
1•tosh•6m ago•0 comments

Electronics engineer – neurotech – London (hybrid/remote)

https://netholabs.com/electronics_engineer_812
1•catubc•9m ago•1 comments

Why Stanford Says AI Agents Become Marxist

https://www.flyingpenguin.com/why-stanford-says-ai-agents-become-marxist/
2•feigewalnuss•15m ago•0 comments

Palestinians forced to demolish own homes to make way for Israeli theme park

https://www.theguardian.com/world/2026/may/16/palestinians-demolish-family-homes-jerusalem-kings-...
3•hebelehubele•16m ago•0 comments

A message from kurdistan – my love for China and DeepSeek

https://old.reddit.com/r/DeepSeek/comments/1tadbm6/a_message_from_kurdistan_my_love_for_china_and/
1•chewz•18m ago•0 comments

Your VPS Is a Sitting Duck

https://github.com/rockballslab/vps-secure
1•rockballslab•20m ago•0 comments

Is Bitwarden Getting Enshitified?

https://www.fastcompany.com/91542655/bitwarden-scrubs-always-free-and-inclusion-values-from-its-w...
1•bobek•27m ago•1 comments

Experience Layer for AI

https://cortexdb.ai/blog/v1
1•prmalik•30m ago•0 comments

Pretext – pure-arithmetic text measurement for proportional fonts

https://somnai-dreams.github.io/pretext-demos/
2•Teever•35m ago•0 comments

TunnelForge, a L2TP client for Android 12

https://github.com/evokelektrique/tunnel-forge
1•femdiya•35m ago•0 comments

The Whitepaper Thunderdome: HAGE vs. Storage Is Not Memory

https://medium.com/@vektormemory/the-whitepaper-thunderdome-hage-vs-storage-is-not-memory-8a76fd6...
1•vektormemory•43m ago•0 comments

Why birth rates are falling everywhere all at once

https://www.ft.com/content/fba35eca-df3a-4ad6-b42d-eb08eb7c9ad3
2•quick_brown_fox•46m ago•0 comments

Trump warns Taiwan against declaring independence

https://www.bbc.com/news/articles/ce8p61v7l68o
2•vrganj•47m ago•1 comments

$2B Conflict: Sam Altman "Side Hustles" Are Now Center of a Legal Warzone

https://www.gadgetreview.com/the-2-billion-conflict-sam-altmans-side-hustles-are-now-the-center-o...
1•g42gregory•48m ago•0 comments

Sense Humans with WiFi – Ruview

https://cognitum.one/RuView#capabilities
1•unixhero•49m ago•0 comments

Goodbye Travel Agents, Hello AI Agents

https://blog.denv.it/posts/goodbye-travel-agents-hello-ai-agents/
2•denysvitali•49m ago•0 comments

Do High-Quality EDC Knives Justify Their Price Gap?

https://www.paragon-knives.com/
1•bgzlsxaz•51m ago•0 comments

Jjw: A Workspace Manager for Jj

https://aran.dev/posts/introducing-jjw-jj-workspace-manager/
1•aranw•56m ago•0 comments

Show HN: New release of jd-GUI-duo 2.0.112 is out

https://github.com/nbauma109/jd-gui-duo/releases/tag/2.0.112
1•nbauma109•56m ago•0 comments

InclusionAI/Ring-2.6-1T is now open-sourced

https://huggingface.co/inclusionAI/Ring-2.6-1T
1•gainsurier•58m ago•0 comments

The Quiet Renovation at Bitwarden

https://blog.ppb1701.com/the-quiet-renovation-at-bitwarden
1•RyeCombinator•59m ago•0 comments

OXP – Write one WASM extension, run natively in VS Code, JetBrains, and Neovim

https://oxp.sh/
2•aldgar•1h ago•0 comments

The Download: deepfake porn's stolen bodies and AI sharing private numbers

https://www.technologyreview.com/2026/05/14/1137257/the-download-deepfake-porn-bodies-ai-exposing...
3•joozio•1h ago•0 comments

Frontier AI has broken the open CTF format

https://kabir.au/blog/the-ctf-scene-is-dead
49•frays•1h ago•23 comments

QuantumGuard – Free Quantum

https://quantumguard.site
1•pavan6599•1h ago•0 comments

Nested Callbacks (2013)

https://blog.michellebu.com/2013/03/21-nested-callbacks/
1•cod1r•1h ago•0 comments

Global News Reporting Briefs

https://www.worldbrief.info
1•reader9274•1h ago•0 comments