
Dear Sebastien Carlier,
In message 4CD3DEFC.7010104@gmail.com you wrote:
1.1) Stop using weak symbols; use pre-initialized function pointers instead (possibly grouped in a struct, for cleanliness). This has the benefit of offering a clear interface and being independent of toolchain details.
And where would the "pre-initialized function pointers" come from? Without adding a hell of #ifdef's ?
1.2) Use regular (non-weak) extern declarations for overridable stuff; collect all default weak symbols into a separate library archive, to be supplied last to the linker.
Not realy practicable, as the code is distributed all over the place, and should remain where it logically belongs.
1.3) Stop using a library archive for the board specific stuff. Instead, collect and link all the object files to produce the output binary. Only Makefile changes are involved, but correct behavior depends on all boards doing the right thing.
Close. I think stop using a library archives and do what Linux does instead is the way to go.
1.4) Link u-boot into a board-agnostic dynamic library, link the board-specific stuff into an executable embedding a dynamic linker, and package all this stuff somehow.
Sounds pretty much complicated.
Best regards,
Wolfgang Denk