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

Is there a Mario Wii Web port?

1•Itzsplicez•3m ago•0 comments

T-Mobile Just Ripped 8M Customers Off Their Grandfathered Plans

https://www.gadgetreview.com/t-mobile-just-ripped-8-million-customers-off-their-grandfathered-pla...
1•momentmaker•6m ago•0 comments

GitHub profiles turned into FIFA Ultimate Team cards, rated out of 99

https://gitfut.com
2•beatthatflight•11m ago•0 comments

Magicbookshelf.org – A Spoiler Free Companion – The Brothers Karamazov

https://magicbookshelf.org/read/the-brothers-karamazov/
2•pfwitt•12m ago•0 comments

Why AI is like a (Clever Hans) Horse [video]

https://www.youtube.com/watch?v=0GQ2RP-25gM
1•tartoran•13m ago•0 comments

Should every baby's DNA be sequenced?

https://www.economist.com/science-and-technology/2026/06/29/should-every-babys-dna-be-sequenced
1•andsoitis•16m ago•0 comments

Prism: An Impure Functional Language with Typed Effects

https://www.stephendiehl.com/posts/prism/
1•ghc•17m ago•0 comments

SRAM as Processing

https://prawns.dev/til/processing-using-sram
1•random__duck•18m ago•0 comments

Open Domesday

https://opendomesday.org/
1•mellosouls•21m ago•0 comments

Moonshot AI (kimi) launches a credit card

https://www.kimi.com/aicard
1•danieltanfh95•22m ago•0 comments

Chinese tycoon sentenced to 30 years in US jail

https://www.bbc.com/news/articles/cjeg15vw3z9o
2•tartoran•23m ago•1 comments

New Student Loan Rules Are Poised to Amp Up Pressure on Colleges

https://www.wsj.com/us-news/education/student-loan-rules-accountability-tuition-earnings-threshol...
1•JumpCrisscross•24m ago•0 comments

Cisco to lay off more than 400 workers in California

https://www.latimes.com/business/story/2026-06-26/cisco-to-lay-off-more-than-400-workers-in-calif...
4•1vuio0pswjnm7•24m ago•0 comments

AI Does Not Have to Kill Humans to End the Human Future

https://kunyuan.substack.com/p/ai-does-not-have-to-kill-humans-to
1•Kiyo-Lynn•26m ago•0 comments

BlackBerry Staged a Comeback by Winning over Car Companies

https://thewalrus.ca/how-blackberry-staged-a-comeback-by-winning-over-car-companies/
2•pseudolus•27m ago•0 comments

The Lake They Couldn't See: gold, dark fiber, and the AI data-center boom

https://cyrusradfar.com/thoughts/the-lake-they-couldnt-see
2•cyrusradfar•27m ago•0 comments

'Humanity has chosen to become idiots': Brown professor discovers mass cheating

https://fortune.com/2026/06/29/roberto-serrano-brown-university-massacre-ai-cheating/
3•1vuio0pswjnm7•27m ago•0 comments

Illinois lawmakers crack down on junk fees, bots in online ticket sales

https://www.nprillinois.org/economy-business/2026-06-26/illinois-lawmakers-crack-down-on-junk-fee...
1•toomuchtodo•34m ago•1 comments

Reports of Anthropic Cutting Usage Limits Again

https://old.reddit.com/r/ClaudeCode/comments/1uim4jb/this_is_a_message_for_anthropic_bring_back_the/
1•quux0r•35m ago•0 comments

Shipwright Harness – open-source autonomous delivery agent for Claude Code (MIT)

https://github.com/app-vitals/shipwright
1•dodizzle•35m ago•0 comments

AI money is going to swamp the midterms this year

https://www.ft.com/content/8f872761-76d9-43c7-bbcd-d313c4732e81
3•1vuio0pswjnm7•35m ago•0 comments

Show HN: Sell Lemons Info – a source-checked Roblox guide site

https://selllemons.info
1•ninglz•37m ago•0 comments

Show HN: TinyAgents – a Rust based recursive LLM harness

https://github.com/tinyhumansai/tinyagents
1•enamakel•41m ago•0 comments

International Fixed Calendar

https://en.wikipedia.org/wiki/International_Fixed_Calendar
1•salamo•45m ago•0 comments

Super Micro Office Raided as Taiwan Expands Nvidia Chip Smuggling Probe

https://finance.yahoo.com/technology/ai/articles/super-micro-office-raided-taiwan-175946955.html
3•ivewonyoung•50m ago•0 comments

An inside look at how the war has damaged Iran's historic sites

https://www.reuters.com/investigates/special-report/iran-crisis-cultural-heritage/
2•1659447091•52m ago•0 comments

Gitfolio.dev – Showcase your best work buried in private repos

https://gitfolio.dev
1•zeeshanejaz•53m ago•1 comments

FriendNet – self-hostable, open source file sharing for friends

https://friendnet.org/
1•Fudgel•1h ago•0 comments

ACCC sues Amazon over alleged unfair conduct for introducing Prime streaming ads

https://www.abc.net.au/news/2026-06-30/amazon-prime-accc-federal-court/106857352
3•Gaishan•1h ago•0 comments

Why Won't Europe Build AI Data Centers in Iceland?

https://mrkt30.com/why-wont-europe-build-ai-data-centers-in-iceland/
12•type0•1h ago•6 comments