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

The X3DH Key Agreement Protocol

https://signal.org/docs/specifications/x3dh/
1•Bluestein•5m ago•0 comments

Market design: affinity networks like shooq, & why a festival should buy afm

http://shooq.danieldeboulay.com
1•deboulaymxf•7m ago•0 comments

Show HN: AudioSort, a web app for sorting audio files

https://audiosort.vakaiser.com/
1•Vakaiser•8m ago•0 comments

Crypto Blew Its Big Moment–and the Blame Game Has Begun

https://www.wsj.com/finance/currencies/crypto-blew-its-big-momentand-the-blame-game-has-begun-dff...
1•JumpCrisscross•10m ago•0 comments

OpenAI expects to burn $280B by 2030

https://www.ft.com/content/6011d061-eee3-4193-b3b7-8ee4155f538c
1•JumpCrisscross•11m ago•0 comments

World Wide Words

https://www.worldwidewords.org/genindex.html
1•Petiver•19m ago•0 comments

Show HN: Puzzle Season – five logic puzzles in the browser

https://puzzleseason.app/play/
1•msminhas•25m ago•0 comments

China doesn't need to beat US AI [video]

https://www.youtube.com/watch?v=sXA77wLF678
1•verdverm•27m ago•1 comments

Show HN: Migrating from Claude Code CLI to Claude Desktop

https://github.com/calebbarzee/claude-profiles
1•calebbarzee•29m ago•0 comments

The Ethics Issue of AI-Assisted Creation

https://im.not.ci/ai-creator-ethic/
3•uneven9434•43m ago•2 comments

Professional cyclists can top 100 km/h. But safety has not kept pace

https://www.cbc.ca/lite/story/9.7345287
1•colinprince•45m ago•0 comments

Show HN: 23k Verified 1P Walmart & Target Products with Preserved UPCs

https://github.com/FluffyTeddyBear12/us-retail-product-dataset
1•jimmied1213•46m ago•0 comments

Line-Rate Post-Quantum Byzantine Consensus via L1D Balanced Ternary

https://github.com/leadpiperl1/ternary-consensus-mesh
1•leadpiperl1•47m ago•0 comments

Scott Jenson: Are we going to use the same Desktop UX forever? [video]

https://www.youtube.com/watch?v=V7AfAcQwLW0
3•tripdout•1h ago•1 comments

RSA-896

https://saweis.net/posts/rsa-896.html
40•madars•1h ago•4 comments

Lattice enumeration: O(R^N) complexity reduced to O(R^2) with no floating point

https://github.com/Andrew-J-Morris/orthotropic-parity-and-discrete-pi
1•MorrisAndrewJ•1h ago•0 comments

Using system-one models inside high-throughput data pipelines

https://www.southbridge.ai/blog/jev-entity-resolution
2•hrishi•1h ago•0 comments

TanStack supply-chain attack exposed ~170 private CrowdSec repos

https://www.crowdsec.net/blog/tanstack-supply-chain-attack-analysis
6•fourfire•1h ago•1 comments

Is It a Flatpak? Is It an AppImage? No It's AppJail

https://www.youtube.com/watch?v=EBSMHBC0Phc
2•DtxdF•1h ago•1 comments

AI Bubble: 'They're coming to the end of this' – Eli the Computer Guy [video]

https://www.youtube.com/watch?v=0YIczZDCgsM
3•baranul•1h ago•0 comments

Show HN: Bastardica – Create bastard web fonts

https://bastardica.mitpit.com
2•MitPitt•1h ago•0 comments

Comparing reflection capabilities of C++, Zig and C3

https://nyr24.github.io/blog/reflection-comparison/
8•ManuLinares•1h ago•2 comments

Do you separate the reviewer's window from the author's

4•Marvin_RunAI•1h ago•1 comments

The Giza Project

https://giza.fas.harvard.edu/
2•Mr_Minderbinder•1h ago•0 comments

Why are AI leaders calling for a slow down? [audio]

https://www.cbc.ca/listen/cbc-podcasts/209-front-burner/episode/16237327-why-are-ai-leaders-calli...
1•BiraIgnacio•1h ago•1 comments

End the H-1B Program

https://end-h1b.com/
17•sergiotapia•1h ago•19 comments

A2E AI – an all-in-one AI video generator for text, images and avatars

https://textideo.com/model/a2e-ai
1•Yummiy•1h ago•0 comments

Pdfcn: Beautiful pdf components, built on Takumi and Forme, by Shadcn

https://github.com/shadcn-labs/pdfcn
4•nateb2022•2h ago•1 comments

Open-source free meme generator, friendly for AI agents and humans

https://github.com/terryds/memegenscript
2•terryds•2h ago•2 comments

Pure Code: What remains with developers after AI writes the code?

https://pure-code-essay.vercel.app/
3•kofdai•2h ago•0 comments