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

Why Windows Is Losing Gamers

https://www.youtube.com/watch?v=2grg4R4fmGs
1•cable2600•2m ago•0 comments

RISC-V: What Matters

https://thechipletter.substack.com/p/risc-v-what-really-matters-and-what
1•signa11•2m ago•0 comments

The Iran War Is a Whole New Level of Quagmire for the US

https://www.politico.com/news/magazine/2026/08/12/the-us-forgot-the-lessons-of-iraq-now-its-despe...
1•hebelehubele•3m ago•0 comments

TreasuryDirect moves authn 100% to ID.me

https://www.treasurydirect.gov/savings-bonds/help-center/faqs/idme-faq/
1•AdamN•4m ago•1 comments

Keyboard Phones Are Back

https://markow.dev/?action=view&url=keyboard-phones-are-back---unihertz-titan-2-elite
1•robowo•9m ago•0 comments

Japanese publishers fight imposter news sites with a cryptographic signature

https://www.niemanlab.org/2026/08/japanese-publishers-are-fighting-imposter-news-sites-with-a-cry...
1•rdmuser•13m ago•0 comments

Practical Introduction to Vim-Fugitive

https://jeancharles.quillet.org/posts/2022-03-02-Practical-introduction-to-fugitive.html
1•auraham•18m ago•0 comments

Vim Fugitive in Action

https://dzx.fr/blog/introduction-to-vim-fugitive/
1•auraham•18m ago•0 comments

Nested Functions with GCC and Clang

https://uecker.codeberg.page/2026-08-06.html
1•matt_d•26m ago•0 comments

We built agents that match people who need help with people offering it

https://ayudagente.help/
1•jsgomezs1•27m ago•1 comments

Principles and Techniques for Designing Precision Machines(1999)

https://www.osti.gov/servlets/purl/8431
1•nill0•37m ago•0 comments

Show HN: I have tried using Honestify instead of sending direct CV/Resume

1•ricky300300•40m ago•0 comments

China's $13K Tiny EV Hit 1k Orders in Japan in Just Two Weeks

https://www.autoblog.com/news/chinas-13k-tiny-ev-hit-1000-orders-in-japan-in-just-two-weeks
2•teleforce•40m ago•0 comments

The Safety Reckoning Inside OpenAI

https://www.wired.com/story/openai-safety-security-ai-agents-culture/
1•sbulaev•41m ago•0 comments

I built AIM Maps but you play AI

https://www.1vs1.xyz/
1•mattmerrick•48m ago•0 comments

Age Verification Is a Bad Way to Solve the Problem. What's the Alternative?

https://techblog.bozho.net/age-verification-is-a-bad-way-to-solve-the-problem-of-children-on-soci...
1•bozho•1h ago•0 comments

We hired a security engineer and got back 123 findings

https://dev.profullstack.com/~anthony/blog/004-post.html
2•buffer_overlord•1h ago•0 comments

Asda rolls out loss prevention tool across full estate following £100k savings

https://www.retailgazette.co.uk/blog/2026/08/asda-rolls-out-loss-prevention-tool-across-full-esta...
2•mmarian•1h ago•0 comments

CARA – a readiness assessment for Microsoft 365 Copilot adoption

https://jellebelletje.github.io/CARA/
1•jelonearth•1h ago•1 comments

Ownership in the Age of AI

https://sahilkolwankar.com/blog/ai-input-not-output/
2•sahilkolwankar•1h ago•0 comments

The quirky personal homepages of programming language creators

https://breck.lol/plMakers.html
39•cjlm•1h ago•11 comments

Decentralized Roller Coaster Tracker

https://aquacoast.net
2•ens0•1h ago•1 comments

Falstad Math and Physics Simulations

https://www.falstad.com/mathphysics.html
2•pykello•1h ago•0 comments

Show HN: DSH Plugin Directory – Every DeepSeek Harness Plugin

https://dshplugin.online/
2•niliu123•1h ago•1 comments

21,000 MCP servers exposed: the protocol reaches a security inflection point

https://forkast.news/the-model-context-protocol-reaches-a-security-inflection-point/
11•Wpnx330•1h ago•1 comments

I checked 30 frontier model cards. Here are the benchmarks labs report

https://koutian.is-a.dev/benchmark-radar/?view=leaderboard
7•ktwu01•1h ago•7 comments

Pizza π, A fun fractions game for kids 6-12

https://pizzapi.vinceroyer.ca/
3•vinistois•1h ago•3 comments

Taliban government supporters dance, take selfies in Kabul celebrations

https://www.channelnewsasia.com/world/taliban-government-supporters-dance-take-selfies-in-kabul-c...
4•Markoff•1h ago•1 comments

The Live Shopping App Where Some People Bid Until They're Broke

https://www.wsj.com/business/retail/whatnot-live-shopping-app-48b67987
5•littlexsparkee•1h ago•0 comments

Wk. 4 of Vibecoding an MMO

https://www.eldermyr.com
3•josiahturnq•1h ago•9 comments