Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: function-level linking (was: Re: newlib File ...)   Message List  
Reply | Forward Message #13805 of 15019 |
RE: [gbadev] re: function-level linking (was: Re: newlib File ...)



> -----Original Message-----
> From: John Seghers [mailto:johnse@...]
> My point was not about how much those specific functions impacted
> the final product. My point was more about granularity in general.
> Function-level linkers handle this on a function-by-function basis
> whether the code is in a library or not.

As far as I'm aware redundant code is not present in the final binary with
optimisation >0. Certainly unreferenced data is removed and on the odd
occasion I've been confused by 'missing' code in my final roms which turned
out to be a typo resulting in code which did nothing.

> This becomes even more important with template libraries, since by
> definition the template class must be in the compilation unit where it
> is used. If you have 10 functions (each of similar complexity) to provide
> the implementation of the template, and your code uses the template
> to instantiate a class, but only uses 2 of those functions, you're stuck
> with code for all 10 being compiled.

This is something I have little experience with - I tend to avoid template
libraries like the plague since they seldom seem to have any consideration
for console platforms. The gcc linker should, given my experience with the
optimization of redundant code, remove unreferenced functions regardless of
the object file granularity.

> A linker that includes everything from a compilation unit in the final
> product will include all of this dead code. A linker that performs
> function-level linking will strip it out.
>
> The specific answer came that newlib is pretty granular--generally
> one function per file--which is good. The GCC tool chain developers,
> however, (whenever I've seen this issue debated) have basically said
> that if you want function-level linking, you have to do it manually--and

I'm not entirely convinced that this is necessary - it certainly warrants a
little research. It does seem to me that this will reduce compile & link
time by reducing the ammount of redundant material present in the object
files but since it appears to me that such material is removed from the
final binary in any case there would be little point in worrying about where
it happens.

Dave





Thu Mar 6, 2003 6:22 am

gameboy_dave
Online Now Online Now
Send Email Send Email

Forward
Message #13805 of 15019 |
Expand Messages Author Sort by Date

... From: <d_yerrick@...> ... My point was not about how much those specific functions impacted the final product. My point was more about granularity...
John Seghers
johnse98072
Offline Send Email
Mar 1, 2003
1:56 pm

... As far as I'm aware redundant code is not present in the final binary with optimisation >0. Certainly unreferenced data is removed and on the odd occasion...
Dave Murphy
gameboy_dave
Online Now Send Email
Mar 6, 2003
9:23 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help