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

Live Image/Video Translation

https://blog.davidv.dev/posts/mobile-translator-video/
1•wonger_•1m ago•0 comments

Time-based background colour transitions with Temporal and CSS color-mix

https://localghost.dev/blog/time-based-background-colour-transitions-with-temporal-and-css-color-...
3•gslin•3m ago•0 comments

WhaleCap: Keep your DeepSeek API credits from running out on day one

https://www.npmjs.com/package/whalecap
1•wayepoint•3m ago•0 comments

RPB – Raylib Project Builder

https://raysan5.itch.io/raylib-project-builder
1•Erenay09•5m ago•0 comments

RPC – Raylib Project Creator

https://raysan5.itch.io/raylib-project-creator
1•Erenay09•5m ago•0 comments

EasyJet reaches 'agreement in principle' over potential takeover

https://www.bbc.com/news/articles/cgjxx7ngz51o
1•a_paddy•6m ago•0 comments

A hot summer trend in the sharing economy? Rental swimming pools

https://text.npr.org/nx-s1-5876505
2•mooreds•7m ago•0 comments

Completing a Computer Science Degree on Coursera

https://notesbylex.com/completing-a-computer-science-degree-on-coursera
3•lexandstuff•7m ago•0 comments

Ask HN: How to get a non-technical friend into tech?

2•yesitcan•8m ago•2 comments

Small details in my Mastodon client that I wanted more people to notice

https://w.on-t.work/outpost-frontend-details
2•birdculture•8m ago•0 comments

Everyone loves apprenticeships. So why can't Britain create more of them?

https://www.ft.com/content/1a19a8c6-2472-497a-8f2e-68ace9532804
2•mmarian•11m ago•1 comments

Show HN: Can I Walk My Dog? Weather-based safety calculator for dog walks

https://rainbow-salmiakki-336e9b.netlify.app/
2•OtmaneBenazzou•16m ago•0 comments

Show HN: Thunderstorm tracker for Mexico England world cup game

https://tlaloc.cloud/
2•mgranados•19m ago•0 comments

Reparaible and open source paper printer

https://www.opentools.studio/
9•bouh•25m ago•0 comments

Dungeon Proof Crawler: learn how to write proofs with RPG

https://dhilst.github.io/algae/game/index.html
8•SchwKatze•28m ago•1 comments

Why New Jersey's balcony solar bill is a huge deal for renters

https://www.cnn.com/climate/new-jersey-balcony-solar-renters
4•breve•30m ago•1 comments

Y Combinator.singles

https://www.ycombinator.singles/
2•nadermx•30m ago•0 comments

Ask HN: Are you guys happy with existing social networkin apps?

7•julienreszka•31m ago•5 comments

Pint in England

https://dispatch-media.com/the-best-pint-in-england/
7•gripfx•32m ago•0 comments

The new Teddy Roosevelt library is a gorgeous extension of the prairie

https://www.fastcompany.com/91568422/theodore-roosevelt-presidential-library
3•eatonphil•33m ago•0 comments

Hollywood's spent 25 years chasing the wrong lessons from The Lord of the Rings

https://www.polygon.com/lord-of-the-rings-25-years-fantasy/
4•HelloUsername•36m ago•0 comments

How to Dox Anyone

https://madattheinternet.substack.com/p/how-to-dox-anyone
10•majorchord•37m ago•2 comments

Show HN: clip.video - Turn podcasts and long videos into short vertical clips

https://clip.video/
2•nadermx•39m ago•0 comments

Organic Maps open source dispute

https://isitreallyfoss.com/projects/organic-maps/
3•maxloh•40m ago•0 comments

What Should We Optimize Away?

https://www.autodidacts.io/holistic-optimization/
2•Curiositry•42m ago•0 comments

Dependencies should be fetched directly from VCS

https://www.arp242.net/deps-vcs.html
4•mrngm•44m ago•0 comments

OpenAI is fast-tracking its own "AI Agent Phone" for 2027 to challenge iPhone

https://old.reddit.com/r/OpenAI/comments/1unbqyd/openai_is_fasttracking_its_own_ai_agent_phone_for/
5•rmason•47m ago•1 comments

Therac-25

https://en.wikipedia.org/wiki/Therac-25
6•thunderbong•47m ago•0 comments

Mercy Otis Warren

https://en.wikipedia.org/wiki/Mercy_Otis_Warren
2•vinnyglennon•48m ago•0 comments

Show HN: Sidenote – comment on your rendered blog, an LLM writes the Git diff

https://github.com/bharadwaj-pendyala/sidenote
2•bharadwajp•49m ago•0 comments