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

Some remarks on being stuck, with digressions on David Hockney

https://www.henrikkarlsson.xyz/p/creative-block
1•jger15•6s ago•0 comments

Are credit rating agencies getting fed up with hyperscalers?

https://www.ft.com/content/623c286b-c973-4488-83f3-97e9016e85f6
1•Betelbuddy•3m ago•0 comments

"When I Created Raspbian for the Raspberry Pi..."

https://twitter.com/OfMikeAndMen/status/2097894902201790904
3•notRobot•6m ago•0 comments

Chinese ship completes first regular Arctic voyage to UK on 'Polar Silk Road'

https://www.abc.net.au/news/2026-09-10/chinese-cargo-ship-completes-arctic-voyage-to-uk/107134378
1•yitchelle•8m ago•0 comments

Our MCP server 401'd on initialize, so no directory could read its tools

https://useanima.sh/blog/mcp-server-invisible-to-directories
1•bogdiyan•9m ago•0 comments

What the iPhone Duo would mean for developers

https://appcompliance.io/blog/iphone-duo-app-compatibility/
1•Eryq78•9m ago•0 comments

Which would you prefer: an iPhone Duo, or an iPhone 18 Pro plus an iPad mini?

1•montgomery_r•11m ago•0 comments

Project Xanadu

https://xanadu.com/
3•simonebrunozzi•13m ago•0 comments

Show HN: Stock charts, insider filings and earnings in one terminal window

https://github.com/makeev/alphai-tui
1•mmakeev•13m ago•0 comments

Show HN: VocReel – A sentence-by-sentence feed for English listening practice

https://vocreel.com
1•ansurfen•14m ago•0 comments

Show HN: A sci-fi systems check for your programming brain

https://systemscheck.dev
2•careyi3•14m ago•0 comments

Show HN: Eusend – the EU-native email API

https://eusend.dev
2•sharecrow•19m ago•0 comments

I bought a monitor extender. No Linux support. I made a driver out of pure rage

https://github.com/N7le/powerology-actions-usb-display-linux-driver
2•MarcellusDrum•21m ago•1 comments

Show HN: SubnetLens – OSS local network scanner built in Go with a TUI

https://github.com/ostefani/subnetlens
3•ostefani•23m ago•0 comments

Lawmakers blast AI companies after researcher warns of human extinction by 2030

https://www.theguardian.com/technology/2026/sep/09/lawmakers-blast-ai-human-extinct-2030
1•chrisjj•24m ago•0 comments

Call of Duty 2 running in Browser. Ported in 10 hours with GPT-6 Astra

https://www.reddit.com/r/aigamedev/comments/1wa11xy/call_of_duty_2_running_in_browser_ported_in_10/
2•magnusl•26m ago•0 comments

Notre Dame to start requiring ACT, SAT test scores again for admissions

https://www.wndu.com/2026/09/09/notre-dame-start-requiring-act-sat-test-scores-again-during-admis...
1•mpweiher•26m ago•0 comments

Ask HN: How do you kill time while LLMs work for you?

2•theletterf•28m ago•2 comments

Dark energy debunked? Cosmic acceleration may be an illusion

https://www.sciencedaily.com/releases/2026/09/260907201600.htm
1•jnord•32m ago•0 comments

Anthropic commerce agent: open-source blueprint for shopping and merchant agents

https://github.com/anthropics/commerce-agents
1•ColinEberhardt•32m ago•0 comments

Why California Is Reconsidering Its Decision to Shun Nuclear Power

https://www.nytimes.com/2026/09/09/business/energy-environment/california-diablo-canyon-nuclear-e...
2•mpweiher•38m ago•0 comments

Email, decoupled from where and how: A cross-runtime/provider email library

https://hackers.pub/@hongminhee/2026/upyo-email-decoupled-from-where-and-how
2•dahlia•40m ago•0 comments

Uruky Launches Scopes and Tags

https://uruky.com/whats-new?il=en
2•BrunoBernardino•40m ago•1 comments

Everything You Always Wanted to Know About Watermarks in Apache Flink

https://developer.confluent.io/blog/all-about-flink-watermarks-1/
1•rmoff•42m ago•0 comments

Open CAD Studio – Free DWG and DXF CAD

https://www.opencadstudio.com/
1•metrofun•42m ago•0 comments

I Was Offered Money to Tell You AI Will Kill Us [video]

https://www.youtube.com/watch?v=lPdmYMHrWKg
3•cmpit•43m ago•1 comments

2026 Coworking Prices Across U.S. Metros

https://www.coworkingcafe.com/blog/coworking-subscription-prices/
1•vanclaude•43m ago•0 comments

"I've spent 3 days working with the new Astra model from OpenAI" / X

https://twitter.com/markgreville/status/2097961443870032351
1•gHeadphone•43m ago•0 comments

Resource for AI Safety and Ethics

https://library.iaseai.org/
1•doener•45m ago•0 comments

Show HN: Free ePub Tools Online – View, Edit and Extract – ePub Toolset

https://epubtoolset.com
1•light001•47m ago•0 comments