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

Bub 0.6.0

https://github.com/bubbuild/bub/releases/tag/0.6.0
1•chojanshang•1m ago•0 comments

Evolving Agent Teams

https://arxiv.org/abs/2610.36848
1•anigbrowl•2m ago•0 comments

Automate the setup and configuration of your Windows development environment

https://github.com/microsoft/WindowsDeveloperConfig/
1•gjvc•5m ago•0 comments

Anthropic: Scaling Misuse Detection with Self-Assessment of Chats

https://twitter.com/AnthropicAI/status/2115871889549865429
3•cft•9m ago•0 comments

Anthropic blocks users for anything touching training larger models

https://twitter.com/jiahaoshao1/status/2116475922190922088
5•pretext•10m ago•0 comments

Hackers broke into four of Canada's top law firms

https://www.theglobeandmail.com/business/article-law-firms-hackers-how-did-it-happen-client-files...
2•Teever•10m ago•0 comments

Expert Knowledge and the Conditions of Its Validity: The Limits of Judgment

https://medium.com/@smoking2man/expert-knowledge-and-the-conditions-of-its-validity-the-limits-of...
1•Aldus551•14m ago•0 comments

Clean-room back end for the official Firebase SDK

https://github.com/arumadev/aruma
1•osama200•14m ago•1 comments

Video on scroll: why scrubbing an MP4 stutters (and what to do instead)

https://beta.scrollsequence.com/blog/video-on-scroll-why-scrubbing-stutters-mp4-vs-image-sequence
1•hellofromalki•16m ago•0 comments

Retrospective: Running a Minimal Homelab Whilst Living with the In-Laws

https://dickingwithdocker.com/posts/minimal-homelab-a-retrospective/
2•glitchcrab•16m ago•0 comments

UPlayer – MPEG-DASH playback using native AVPlayer

https://github.com/MaximKomlev/UPlayer
1•maxkomleu•17m ago•0 comments

Tangled, hire a front-end accessibility expert

https://dbushell.com/2026/11/01/tangled-accessibility/
1•Destiner•18m ago•0 comments

Show HN: Castov – Open-source dev tools and AI secret shield with zero telemetry

https://castov.com
1•castov•19m ago•0 comments

Fifty Years of the Selfish Gene

https://www.theguardian.com/commentisfree/2026/oct/30/the-guardian-view-on-50-years-of-the-selfis...
2•bloak•20m ago•0 comments

OpenCiv3 Dutch 2 now available

https://forums.civfanatics.com/threads/release-openciv3-dutch-2-now-available.705287/
1•Alpi•23m ago•1 comments

Cisco gives engineer unlimited AI tokens to rewrite company's legacy code

https://www.tomshardware.com/tech-industry/big-tech/cisco-gives-27-year-old-engineer-unlimited-ai...
1•runwithdata•24m ago•0 comments

How wise do our mentors need to be?

https://www.autodidacts.io/how-wise-do-our-mentors-need-to-be/
3•Curiositry•27m ago•0 comments

Half-Life – Nintendo 64 Port [video]

https://www.youtube.com/watch?v=jcmNEaTzHOU
1•usernameis42•28m ago•1 comments

Show HN: NES Contra (1987) port (ASM –> C and then C –> WebAssembly)

https://epoyraz.github.io/nes-contra-us/
2•tevlon•30m ago•0 comments

Show HN: [Pulse] Thanks to C, I have a project with which I am happy

1•xerrs•31m ago•0 comments

Inference engine in game scripting language using macros

https://dasllama.io/articles/2026-10-28-the-need-for-speed.html
2•BorisTheOptimiz•32m ago•0 comments

TCP Use-After-Free: CVE-2026-98432 / CVSS 9.8

https://atlasum.net/blog/cve-2026-98432-linux-ipv4-tcp-uaf
8•oger•33m ago•1 comments

Good and Bad Procrastination (2005)

https://paulgraham.com/procrastination.html
1•7777777phil•34m ago•0 comments

Electrification Could Cut Global Energy Use in Half

https://fullycharged.show/podcasts/podcast-361-why-electrification-could-cut-global-energy-use-in...
3•toomuchtodo•35m ago•1 comments

Create an Account [Satire/Game]

https://maurycyz.com/fun/account.html
2•Curiositry•38m ago•0 comments

The Duty of a Scholar

https://www.daemonology.net/blog/2026-10-31-The-Duty-of-a-Scholar.html
23•gslin•41m ago•4 comments

Control legacy Fender Mustang amps from the browser via WebHID

https://jorik.dev/refuse/
1•jtangelder•42m ago•1 comments

2.5 hrs of makeup: Japan teen struggles with social media beauty standards

https://mainichi.jp/english/articles/20261029/p2a/00m/0na/004000c
5•giuliomagnifico•42m ago•1 comments

Free Invoice Generator Online

https://gccinvoice.com/free-invoice-generator
3•yourmahbub•43m ago•1 comments

Hurry Curry – FOSS multiplayer cooking simulation game

https://hurrycurry.org/
1•basilikum•43m ago•0 comments