Hi Wolfgang, On Fri, Jun 13, 2008 at 12:09 AM, Wolfgang Denk <[EMAIL PROTECTED]> wrote: > 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. > OK. We'll try to figure out something else. Makefile modification looked like a major PITA to do this anyway, which is why I didn't just go ahead and do it.
> 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 > thanks, Ben ------------------------------------------------------------------------- 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