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

Global warming may have halted an emerging Ice Age, study suggests

https://phys.org/news/2026-10-global-halted-emerging-ice-age.html
1•duck•13s ago•0 comments

247A, Notes 4: Weighted estimates and pseudodifferential operators

https://terrytao.wordpress.com/2026/11/12/247a-notes-4-weighted-estimates-and-pseudodifferential-...
1•smilelamp•2m ago•0 comments

For Silicon Valley leaders, cozying up to the Trump administration was a mistake

https://www.theatlantic.com/ideas/2026/11/silicon-valley-trump-administration/689360/
3•e2e4•9m ago•0 comments

A $5.7T Face-Plant

https://www.theatlantic.com/technology/2026/11/jensen-huangs-icarus-complex/689393/
1•petethomas•10m ago•0 comments

PancakeSlicer: Self-hostable and non-planar slicer for 3D Printing

https://github.com/ZimengXiong/PancakeSlicer
1•danielepolencic•11m ago•0 comments

JSON Is Lying to You

https://blog.gaborkoos.com/posts/2026-08-03-Your-JSON-Is-Lying-to-You/
1•fagnerbrack•12m ago•0 comments

Show HN: Wonderchat – A Zendesk alternative that doesn't charge per seat

https://wonderchat.io/
2•walkingsunrise•13m ago•0 comments

Secure Exclaves and Ambient Sensing

https://security.apple.com/blog/secure-exclaves/
1•nnx•13m ago•0 comments

The Miracle Cure: In 1977, a drug rejected by doctors became a sensation

https://slate.com/technology/2026/11/doctor-medicine-cancer-cure-pill-history.html
1•mutexjp•14m ago•0 comments

Show HN: LinkBunny Shooter

https://linkbunnyshooter.com/
1•hboon•20m ago•0 comments

Show HN: Zero-axiom Lean 4 proof of Yang–Mills R^4 defect via Peano arithmetic

https://github.com/Dr-Logvinovich/round-square
3•DRLogvinovich•25m ago•0 comments

Introducing: Qualiaphobic AI – By Erik Hoel

https://www.theintrinsicperspective.com/p/introducing-qualiaphobic-ai
1•RebelPotato•35m ago•0 comments

The White House is apparently a popular residential proxy exit spot

https://www.theregister.com/security/2026/11/05/the-white-house-is-apparently-a-popular-residenti...
2•noorsimar•36m ago•1 comments

United Airlines blocks AI agents from booking flights

https://techcrunch.com/2026/11/12/united-airlines-blocks-ai-agents-from-booking-flights-citing-cy...
3•askadityapandey•38m ago•1 comments

Gathering any crazy hardware ideas – iron man suit?

1•EricZ0115•39m ago•1 comments

Show HN: Chap – Meeting notes from live captions (no bot) with any LLM or agent

https://chatpanel.net/
2•veeragoni•41m ago•0 comments

Researchers detail over 1,500 verified cases of children with past-life memories

https://www.wbur.org/hereandnow/2026/11/11/child-reincarnation
3•ajmagnifico•52m ago•1 comments

Show HN: PracticeCalculus, learn calculus by solving problems

https://practicecalculus.com
2•ohpauladams•53m ago•0 comments

Global Microsoft Outage

https://www.cnn.com/2026/11/12/business/live-news/microsoft-global-outage-intl-hnk
13•TechTechTech•54m ago•0 comments

Intelligent women get less help at work, study finds

https://www.dw.com/en/intelligent-women-get-less-help-at-work-study-finds/a-79910881
2•rohanm93•54m ago•0 comments

Gen X will outnumber Boomers in Congress for the first time

https://www.kadoa.com/congress/insights/congress-generations
2•hubraumhugo•55m ago•1 comments

Anthropic Says Its AI Model Cut AMD Chip Switch to Three Days

https://finance.yahoo.com/technology/ai/articles/anthropic-says-ai-model-cut-154824196.html
2•cyh555•56m ago•0 comments

Microsoft says attempts to fix global outage not going 'as expected'

https://www.bbc.com/news/live/cq5y10ge3dp3t
12•saikatsg•1h ago•6 comments

Use systemd-run as an alternative for screen

https://makandracards.com/operations/521736-systemd-run-alternative-screen
4•ankitg12•1h ago•0 comments

I let an LLM use my TUI like a user. It found multiple UX bugs

https://github.com/con-dog/clingon
3•purple-leafy•1h ago•0 comments

How can you easily merge multiple PST file?

https://www.mailsdaddy.com/pst-merge-and-join/
1•rajatjaw•1h ago•0 comments

Alex Evans at Umbra Ignite 2015: Learning from Failure [video]

https://www.youtube.com/watch?v=u9KNtnCZDMI
1•1e1a•1h ago•0 comments

Skills I'm Willing to Let AI Have

https://niksmac.me/blog/skills-im-willing-to-let-ai-have/
1•niksmac•1h ago•0 comments

Huang is just the start: Spy agencies warn of 'honey trap' revival

https://www.afr.com/technology/jensen-is-just-the-start-spy-agencies-warn-of-honey-trap-revival-2...
3•geox•1h ago•2 comments

Show HN: Mind Blobs – a browser RTS where you win by befriending, not fighting

https://neojex.itch.io/mind-blobs
1•frazer•1h ago•0 comments