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

Where Does the Tone Come from in a Microphone Preamp? [video]

https://www.youtube.com/watch?v=K-vIeA7yy6Q
1•BrokenCogs•32s ago•0 comments

Ask HN: It's World Social Media Day. Which current ones you do and don't enjoy?

1•busymom0•57s ago•0 comments

The mise en abyme in the Drowned World by James G. Ballard [pdf]

https://dialnet.unirioja.es/descarga/articulo/10247620.pdf
1•jruohonen•1m ago•0 comments

Codegrain – browser-based PDF/image/data tools, files never leave your tab

https://private-tools.codegrain.dev/en
1•shaidiuk•1m ago•0 comments

So, did Dolly from 'Moonraker' wear braces or not?

https://old.reddit.com/r/skeptic/comments/1uhwkh4/so_did_dolly_from_moonraker_wear_braces_or_not/
1•Teever•2m ago•0 comments

./the-bored-engineer –episode=1

https://github.com/quantumwake/kas
1•boredengineer•3m ago•0 comments

Booz Allen: What's in America's Code? Testing U.S. and Chinese LLMs for Security

https://www.boozallen.com/expertise/cybersecurity/whats-in-americas-code.html
1•jlark77777•4m ago•0 comments

Anonymous researcher drops 0-day 'exploitarium' repo

https://www.theregister.com/security/2026/06/29/anonymous-researcher-drops-0-day-exploitarium-rep...
1•logickkk1•4m ago•0 comments

Supreme Court strikes down executive order ending birthright citizenship

https://www.scotusblog.com/2026/06/supreme-court-strikes-down-trumps-order-ending-birthright-citi...
1•hallole•4m ago•0 comments

Show HN: Don't ask if devs cheat with AI, test if they're good with it

https://tryevaluator.com
2•skyepstein•8m ago•1 comments

The Origin of Continents and Geology's Theory of Everything

https://worksinprogress.co/issue/on-the-origin-of-continents/
1•duffycommaryan•9m ago•0 comments

Scammers Sell Seeds for Exotic AI-Generated Flowers That Don't Exist

https://www.404media.co/scammers-sell-seeds-for-exotic-ai-generated-flowers-that-dont-exist/
3•Brajeshwar•9m ago•0 comments

Show HN: Let your AI agent manage your link in bio

https://keepp.link/keepp-skill/SKILL.md
1•vasanthps•9m ago•0 comments

The Beauty of Tautologies

https://scottsumner.substack.com/p/the-beauty-of-tautologies
1•surprisetalk•9m ago•1 comments

Show HN: FastReact – FastAPI and React Starter Kit for AI SaaS

https://fastreact.dev/
1•turtledevio•10m ago•0 comments

Claude Code Is Steganographically Marking Requests

https://thereallo.dev/blog/claude-code-prompt-steganography
3•kirushik•10m ago•0 comments

OSS Rust Web framework inspired by Nest.js

https://rustnidus.com/
1•Vicbona•11m ago•0 comments

Why don't tech workers see themselves as workers?

https://techwerkers.nl/en/posts/myth-of-middle-class/
2•lowbar•12m ago•2 comments

We encode time in space, and pay in complexity

https://notes.shixiangxi.com/en/docs/dual-world-theory/preface/
2•sxx0•12m ago•1 comments

The Cantillion Effect – Adam Smith Institute

https://www.adamsmith.org/blog/the-cantillion-effect
2•bilsbie•15m ago•0 comments

Everything Easy is Hard Again (2018)

https://frankchimero.com/blog/2018/everything-easy/
3•downbad_•15m ago•1 comments

Samsung, SK Hynix to Spend $520B on Chip Plants in South Korea

https://www.wsj.com/tech/samsung-sk-hynix-to-spend-520-billion-on-chip-plants-in-south-korea-7d50...
2•mushstory•15m ago•0 comments

Benchmarks and Obscurantism: A "red" line that should not be crossed

https://clickhouse.com/blog/databricks-reyden-benchmark-transparency-clickhouse
1•lightningspirit•16m ago•0 comments

LLM KOSH

https://github.com/rastogivaibhav/llm-kosh
1•rastogivaibhav•16m ago•0 comments

VSCode-pull-request-GitHub repeatedly asked to sign in again using GitHub

https://github.com/microsoft/vscode-pull-request-github/issues/8786
1•Klaster_1•19m ago•0 comments

No Systemd

https://nosystemd.org/
2•standeven•19m ago•0 comments

The labor share of income in the US is at its lowest post-war level

https://libertystreeteconomics.newyorkfed.org/2026/06/the-post-covid-decline-in-the-labor-share/
99•loughnane•19m ago•21 comments

Study Reveals How Leukemia Cells Enter and Damage Lungs

https://nyulangone.org/news/study-reveals-how-leukemia-cells-enter-and-damage-lungs
3•gmays•20m ago•0 comments

Supreme Court strikes down limits on party spending in federal elections

https://apnews.com/article/supreme-court-campaign-finance-party-spending-ohio-91e49ee112197ae1210...
3•khriss•20m ago•1 comments

Agents in Orbs

https://ampcode.com/news/agents-in-orbs
2•tosh•21m ago•0 comments