frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•11mo 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•11mo 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•11mo 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).

Samsung Hits $1T Valuation Amid Apple Chip Diversification Talks

https://www.macrumors.com/2026/05/06/samsung-1-trillion-valuation/
1•tosh•3m ago•0 comments

Building the TD4 4-Bit CPU

https://jayakody2000lk.blogspot.com/2026/05/building-td4-4-bit-cpu.html
1•zdw•7m ago•0 comments

The [hallucinated] –I-tell-you-shut-up flag

https://til.andrew-quinn.me/posts/the-i-tell-you-shut-up-flag/
1•hiAndrewQuinn•7m ago•0 comments

Dashboard tracking the 100-day promises of the Nepali government

https://digitalpratipakshya.com/
1•laxmena•18m ago•0 comments

Ws-low-level 1.0.1 for Node.js

https://www.npmjs.com/package/ws-low-level
1•jonlachlan•18m ago•1 comments

Samsung to exit China home appliance sales amid shrinking market share

https://www.chinadaily.com.cn/a/202604/28/WS69f0b8d3a310d6866eb46090.html
1•Markoff•20m ago•1 comments

Bun project's GitHub bot has now made more contributions to Bun than Jarred

https://twitter.com/i/status/2052133374018699373
2•thunderbong•24m ago•0 comments

Most Widely Deployed and Used Database Engine

https://sqlite.org/mostdeployed.html
2•sebmellen•33m ago•0 comments

Ask HN: What do you still do manually in 2026 that should be automated?

3•lishunsheng•35m ago•0 comments

A Dark-Money Campaign Is Paying Influencers to Frame Chinese AI as a Threat

https://www.wired.com/story/super-pac-backed-by-openai-and-palantir-is-paying-tiktok-influencers-...
6•mikhael•36m ago•2 comments

Show HN: Image2Obsidian

https://github.com/a-funk/image2obsidian
1•afunk•37m ago•0 comments

SQLite Archive Files

https://sqlite.org/sqlar.html
3•tehlike•37m ago•0 comments

Immer: Immutability the easy way (2018)

https://medium.com/hackernoon/introducing-immer-immutability-the-easy-way-9d73d8f71cb3
1•nateb2022•41m ago•0 comments

IndyCar Officiating explains roots of Long Beach P2P failure

https://racer.com/2026/05/05/indycar-officiating-explains-roots-of-long-beach-p2p-failure
2•rascul•42m ago•0 comments

Zustand: Bear necessities for state management in React

https://github.com/pmndrs/zustand
2•nateb2022•45m ago•0 comments

The Original Super Mario 64 Is Now Playable on GBA

https://retrododo.com/the-original-super-mario-64-is-now-playable-on-gba/
3•y1n0•45m ago•0 comments

PatchSiren – stack-aware CVE alerts. What would make this useful?

https://patchsiren.com
2•SaaSRobinHood•45m ago•0 comments

Whistleblower David Grusch on "Non-Human" Biologics and Craft [video]

https://www.youtube.com/watch?v=Q3BpTZXmDns
1•keepamovin•45m ago•0 comments

ProgramBench: Can Language Models Rebuild Programs from Scratch?

https://arxiv.org/abs/2605.03546
3•jonbaer•46m ago•0 comments

Bitburner (Open source JavaScript-based hacking automation game): v3.0 released

https://store.steampowered.com/app/1812820/Bitburner/
2•mister_mort•58m ago•1 comments

Budgetbreeze: AI-Assisted Personal Finance

https://www.budgetbreeze.io/
3•boxstream•58m ago•1 comments

Incus 7.0 LTS Released

https://lwn.net/Articles/1071469/
1•kazu11max17•1h ago•0 comments

Analysis Paralysis: Folders

https://nonogra.ph/analysis-paralysis-folders-05-06-2026
3•dekdrop•1h ago•0 comments

We programmed a program to program new programs (2011)

https://www.smbc-comics.com/comic/2011-09-08
11•Georgelemental•1h ago•1 comments

Diskless Linux boot using ZFS, iSCSI and PXE

https://aniket.foo/posts/20260505-netboot/
3•stereo-highway•1h ago•0 comments

TogetherLoop – Social media minus the nonsense

https://togetherloop.com/
3•DoctorOW•1h ago•1 comments

How Elon Musk Left OpenAI, According to Greg Brockman

https://techcrunch.com/2026/05/06/how-elon-musk-left-openai-according-to-greg-brockman/
6•evo_9•1h ago•2 comments

Umka: A statically typed embeddable scripting language

https://github.com/vtereshkov/umka-lang
3•modinfo•1h ago•0 comments

Riju: Fast online playground for every programming language

https://riju.codes/
3•gurjeet•1h ago•0 comments

How AI Works Under the Hood – LLMs Explained with Code

https://nitayneeman.com/blog/how-ai-works-under-the-hood-llms-explained-with-code/
5•thunderbong•1h ago•0 comments