In message <[EMAIL PROTECTED]> you wrote: > > I've played around a bit more and found that if I move my function to > an existing file containing functions called from elsewhere, my code > gets linked in. Further research shows that a 'feature' of ld is that > it won't pull in a module that only has symbols that have already been > resolved, even if the previously found version is weak.
Argh... That's evil, but given the way ld works, I think I can understand it. > IMHO, developers should be able to write board and cpu code to > override weak symbols in libraries/drivers without having to worry > about whether the intention was obeyed or not. ld has a switch > '--whole-archive', that will pull in an entire archive, not just the > modules that are referenced elsewhere with strong linkage. Oh no. Please don;t even mention this... > I propose to wrap both the 'board/$(BOARDDIR)/lib$(BOARD).a' and > 'cpu/$(CPU)/lib$(CPU).a' arguments to ld in > --whole-module/--no-whole-module in order to accomplish this goal. We > definitely don't want to do this across the board because image size > will increase quite a bit due to unused code. I believe that the > board and cpu code, though, should be mostly free of cruft. If not, > it should be restructured with appropriate CONFIGs, either in > Makefiles or C code. No, please do NOT do that. This will become a PITA. Maybe somebody has a really clever idea, but I'm afraid we might end up having to put all "strong" functions that are supposed to overwrite weak ones into separate modules that get pulled in unconditionally :-( Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED] Committee, n.: A group of men who individually can do nothing but as a group decide that nothing can be done. - Fred Allen ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users