z88dk forums

z80 Development Kit

You are not logged in.

#1 2019-04-13 01:13:21

Registered: 2017-11-24
Posts: 26

Dead code culling at link time.

This is an advanced issue (I think anyway), but is there a plan afoot to perform dead
code culling at link time.

I ask since my code is getting rather large and I have not figured out a good way to clean
out routines that are not in fact being used. 

On the surface it seems easy enough, just scan the binary and look for call/jumps to code
that is listed in the globals section. 

Well any way, is someone thinking about such a thing ?




#2 2019-04-13 10:17:10

Registered: 2007-07-15
Posts: 1446

Re: Dead code culling at link time.

Itís on Pauloís wish list for the next gen version of z80asm: https://github.com/z88dk/z80asm/wiki

If you rearrange your project to one function per file and create a library then itís feasible now, just a little awkward to manage.

Alternatively you could do it manually by compiling to object files, using z80nm and then manually excluding code.



Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson