From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 06 Feb 2012 21:53:17 +0100 Subject: [U-Boot] [PATCH 2/2] RFC: Let linker create phy array In-Reply-To: <201202051540.04502.vapier@gentoo.org> References: <1328410966-13946-1-git-send-email-troy.kisky@boundarydevices.com> <201202042238.42038.vapier@gentoo.org> <4F2E83A1.8020503@aribaud.net> <201202051540.04502.vapier@gentoo.org> Message-ID: <4F303DBD.7050802@aribaud.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 05/02/2012 21:40, Mike Frysinger a ?crit : > On Sunday 05 February 2012 08:26:57 Albert ARIBAUD wrote: >> Le 05/02/2012 04:38, Mike Frysinger a ?crit : >>> On Saturday 04 February 2012 22:02:46 Troy Kisky wrote: >>>> --- a/include/phy.h >>>> +++ b/include/phy.h >>>> >>>> +extern struct phy_driver __phy_entry_start, __phy_entry_end; >>> >>> linker symbols should be declared like: >>> extern char __phy_entry_start[]; >> >> Why should they? > > because that's what the GNU linker documentation says to, and that's how all > existing symbols have been handled. look at asm/sections.h in every Linux > arch. Does it? What I read from never says that linker-defined symbols should be declared in source code as char[]; actually, it gives examples where linker-defined symbols are defined with types int and char, not char[]. What the section says, OTOH, is that one must remember that the linker will not allocate space for a symbol unless explicitly instructed to, so such symbols my not have meaningful values, only addresses, and the code should access these symbols by address -- which is what is being done in the code of the RFC patch IIUC. > -mike Amicalement, -- Albert.