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

Show HN: I used Claude to make some free fun pet-themed browser arcade games

https://whatpetshouldiget.com/play.html
1•scamdrill•3m ago•0 comments

Evaluating the impact of two decades of USAID intervention

https://www.thelancet.com/action/showPdf?pii=S0140-6736%2825%2901186-9
2•Topfi•4m ago•0 comments

How the Bayeux Tapestry broke the internet

https://spectator.com/article/how-the-bayeux-tapestry-broke-the-internet/
1•thinkingemote•4m ago•0 comments

Laguna XS 2.1 33B on a RTX 3090: 296 tok/s peak, 152 tok/s at 256K context

https://www.lucebox.com/blog/laguna-xs21
1•GreenGames•4m ago•0 comments

Show HN: Check your RAG agent's literal groundedness with verbatimeter

https://pypi.org/project/verbatimeter/
1•pobonin•8m ago•0 comments

List of OpenAI Whisper Checkpoints Variants

https://blog.sparsh.dev/list-openai-whisper-checkpoints-variants/
1•sparshrestha•12m ago•1 comments

Lobster Is Migrating to SQLite

https://github.com/lobsters/lobsters/pull/1927
1•maxloh•13m ago•0 comments

San Francisco Inches Closer to PG&E Acquisition

https://www.kqed.org/news/12090521/san-francisco-inches-closer-to-pge-acquisition
1•rdoherty•14m ago•0 comments

Show HN: SignalPosts – turns sales call transcripts into LinkedIn posts

https://www.signalposts.com
1•mistaflu•15m ago•0 comments

'Ghostcommit' hides prompt injection in images to fool AI agents, steal secrets

https://www.bleepingcomputer.com/news/security/ghostcommit-hides-prompt-injection-in-images-to-fo...
1•Brajeshwar•15m ago•0 comments

Show HN: Agent World – an open standard and live market for personal AI agents

https://github.com/macrokit/agent-world
1•spriterock•15m ago•0 comments

Disappearing Polymorph

https://en.wikipedia.org/wiki/Disappearing_polymorph
1•hliyan•16m ago•0 comments

Spacetime as a discrete computational NavMesh: Deriving a 0.8723as universal r.r

https://zenodo.org/records/21273378
1•TomerHaimovich•16m ago•0 comments

Google deleting all recently inactive accounts without phone number

4•superkuh•17m ago•2 comments

Can we reconstruct a tokenizer using only two oracles from the chat API?

https://old.reddit.com/r/LocalLLaMA/comments/1utc5b9/can_we_reconstruct_a_closedsource_llm_tokeni...
1•bayes-song•17m ago•1 comments

Show HN: TargetBridge – Use an Intel iMac as a Thunderbolt Display Apple Macs

https://github.com/swellweb/targetBridge
1•targetbridge•18m ago•0 comments

Fixed-Point Combinator

https://en.wikipedia.org/wiki/Fixed-point_combinator
3•tosh•24m ago•0 comments

Deep dive into iroh, a peer-to-peer communication layer for your application

https://kerkour.com/iroh-v1-p2p
8•cold_pizz4•24m ago•1 comments

Is Life Just Different?

https://www.quantamagazine.org/is-life-just-different-20260708/
1•snorbleck•24m ago•0 comments

Religion: Meanings of Marx' "Opium of the People" [video]

https://www.youtube.com/watch?v=C14q4DOVFno
2•penguin_booze•26m ago•0 comments

Cuelume – Tiny interaction sounds that make interfaces feel alive

https://cuelume-site.pages.dev/
2•lumannnn•30m ago•0 comments

Fdisk and the Importance of Sleep

https://parlaiment.bearblog.dev/fdisk-and-the-importance-of-sleep/
1•vonargo•30m ago•0 comments

LingBot-World 2.0: Open-source world model with hour-long interactive generation

https://github.com/Robbyant/lingbot-world-v2
1•Kajaking•31m ago•0 comments

Rebuilding My Homelab with Compose, Ruby, IPv6, and No Kubernetes

https://www.petekeen.net/homelab-resolved/
2•zrail•34m ago•1 comments

Apple sues OpenAI over mass IP theft

https://appleinsider.com/articles/26/07/10/apple-sues-openai-previous-vp-of-product-design-over-m...
3•kristianpaul•36m ago•1 comments

Show HN: I turned my quote collection into a walkable 3D library (desktop-only)

https://jakubhalmes.com/library/
2•jac08h•37m ago•2 comments

The Mind-Bending Company That Gets a Million Job Applications–and Rejects 99.9%

https://www.wsj.com/business/bending-spoons-jobs-hiring-stock-eaed2b8e
2•fortran77•39m ago•1 comments

Barbarians at the Gateways (2013)

https://queue.acm.org/detail.cfm?id=2536492
1•tosh•40m ago•0 comments

Show HN: Learn by rebuilding Redis, Git, a database from scratch

https://shipthatcode.com
2•acley•41m ago•0 comments

Speculations Concerning the First Ultraintelligent Machine (1965) [pdf]

https://languagelog.ldc.upenn.edu/myl/Good1964.pdf
9•zetalyrae•48m ago•0 comments