From: Wolfgang Denk Date: Fri, 05 Nov 2010 13:14:07 +0100 Subject: [U-Boot] Weak symbols: request for comments In-Reply-To: <4CD3DEFC.7010104@gmail.com> References: <4CD3DEFC.7010104@gmail.com> Message-ID: <20101105121407.654B412A81E2@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 -- 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: wd at denx.de Chapter 1 -- The story so far: In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.