frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•6mo 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•6mo 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•6mo 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).

India's Biggest Airline Falls into Chaos, Canceling More Than 1k Flights

https://www.nytimes.com/2025/12/05/business/india-indigo-airline-cancelations.html
2•bookofjoe•1m ago•1 comments

Prosopometamorphopsia and Facial Hallucinations [pdf]

https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(14)61690-1/fulltext
1•thunderbong•1m ago•0 comments

Sega Dreamcast port of Star Fox 64

https://github.com/jnmartin84/sf64-dc
1•Venn1•3m ago•0 comments

Endangered bottlenose whale population begins to recover off Canada's east coast

https://news.mongabay.com/2025/12/a-rare-bright-spot-for-whales-decades-of-conservation-pay-off-f...
1•randycupertino•4m ago•0 comments

The Quest to Replace Passwords: a comparative evaluation of Web authn schemes

https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-817.html
1•BinaryIgor•8m ago•0 comments

Show HN: I built (yet another) AI writing app for macOS

https://textwisely.ai/
1•EdgarsHQ•10m ago•0 comments

MYRA stack – Modern Java FFM based libraries

https://www.roray.dev/blog/myra-stack/
1•clanky•11m ago•0 comments

Apple's chief chip architect has reportedly talked to CEO Tim Cook about leaving

https://www.tomshardware.com/tech-industry/apples-chief-chip-architect-for-the-last-decade-has-re...
1•gloxkiqcza•12m ago•1 comments

Crash, bang, wallop what a picture – Shane Black's film writing techniques

https://www.theguardian.com/film/2009/may/22/shane-black-12-rounds
1•lifeisstillgood•13m ago•0 comments

Australian teens are planning to get around their social media ban

https://www.newscientist.com/article/2507241-how-australian-teens-are-planning-to-get-around-thei...
1•ironyman•13m ago•1 comments

Semantic Compression (2014)

https://caseymuratori.com/blog_0015
3•tosh•23m ago•0 comments

What the heck is going on at Apple?

https://www.cnn.com/2025/12/06/tech/apple-tim-cook-leadership-changes
3•methuselah_in•23m ago•1 comments

Fluently AI English app review, by a qualified English teacher [video]

https://www.youtube.com/watch?v=B5hQkrOGnmY
2•runarberg•25m ago•1 comments

SigmaTest: A no-holds, < 60KB C testrunner with memleak detection

https://github.com/Quantum-Override/sigma-test/tree/v1.0.0-release
1•thebadkraft•27m ago•1 comments

Domain Modeling Made Denumerable

https://github.com/sgoguen/DenseCheck/blob/main/docs/2025/12/02-Happy-FS-Advent.md
1•dread88•27m ago•0 comments

Tech hopefuls are listing SF in their online bios even if they don't live there

https://www.businessinsider.com/tech-hopefuls-list-san-francisco-online-bios-live-elsewhere-2025-10
1•randycupertino•30m ago•1 comments

Chatting about Shadow DOM

https://thehistoryoftheweb.com/chatting-about-shadow-dom/
1•Brajeshwar•33m ago•0 comments

SQL Murder Mystery Solved

https://kick.com/implabinash
2•implabinash•33m ago•1 comments

Ziglings: Learn the Zig programming language by fixing tiny broken programs

https://codeberg.org/ziglings/exercises/#ziglings
3•tosh•34m ago•0 comments

When AI coding crossed the speed threshold

https://betweentheprompts.com/speed-threshold/
2•scastiel•34m ago•0 comments

The AI Wildfire Is Coming. It's Going to Be Painful and Healthy

https://ceodinner.substack.com/p/the-ai-wildfire-is-coming-its-going
2•LordAtlas•34m ago•0 comments

Scaling by "delegation" isn't good enough (2015)

https://longform.asmartbear.com/delegation/
2•Brajeshwar•36m ago•0 comments

Ask HN: Why don't we teach technical founders to sell their vision?

1•jclopezsDS•37m ago•1 comments

Show HN: A Vaadin 24, Spring algebra calculator with dynamic variable buttons

1•bellaOxmyx•37m ago•1 comments

Europe Is Under Siege

https://www.noahpinion.blog/p/europe-is-under-siege
2•mpbart•38m ago•1 comments

Teenagers Circumvent Australia Social Media Ban

https://www.bbc.co.uk/news/articles/crk7xgzj8y8o
1•microsoftedging•38m ago•0 comments

P-computers can solve spin-glass problems faster than quantum systems

https://news.ucsb.edu/2025/022239/new-ucsb-research-shows-p-computers-can-solve-spin-glass-proble...
2•magoghm•40m ago•0 comments

I Have a Human Arm

https://world.hey.com/ricardo.tavares/i-have-a-human-arm-75d11858
2•rickdg•42m ago•1 comments

Critical flaws found in AI development tools are dubbed an 'IDEsaster'

https://www.tomshardware.com/tech-industry/cyber-security/researchers-uncover-critical-ai-ide-fla...
2•prng2021•43m ago•0 comments

Ludwig Minelli, Founder of Swiss Assisted-Suicide Group Dignitas, Dies at 92

https://www.nytimes.com/2025/12/03/world/europe/ludwig-minelli-dead.html
2•bookofjoe•43m ago•2 comments