From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Thu, 02 Dec 2010 08:51:09 +0100 Subject: [U-Boot] [PATCH] ARMv7: Fix linker errors across toolchain versions In-Reply-To: <20101202073437.8C64FEA6600@gemini.denx.de> References: <1291216634-7510-1-git-send-email-premi@ti.com> <4CF68230.7060107@free.fr> <4CF68693.1050406@free.fr> <4CF695B6.2010106@free.fr> <4CF6C09A.7050206@free.fr> <4CF743E6.60706@free.fr> <20101202073437.8C64FEA6600@gemini.denx.de> Message-ID: <4CF74FED.2030102@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wolfgang, Le 02/12/2010 08:34, Wolfgang Denk a ?crit : > Dear Albert ARIBAUD, > > In message<4CF743E6.60706@free.fr> you wrote: >> >> Starting with the fact that the linker issue is only for one board, >> omap3_evm, I looked up the board-specific code. First thing that I >> noticed was >> >> static u8 omap3_evm_version; >> >> I changed this to >> >> static u8 omap3_evm_version = 1; >> >> so that the static was moved out of BSS and the linker warning >> disappeared (reminder: v2010.12-rc2, omap3_evm, arm-2010q1). >> >> Now this is not the first static BSS variable we use in U-Boot, and the >> others did not cause linker warnings (not *all* the others, at least), >> so the real cause is yet unknown to me. But that's at least a lead we >> can follow. > > Write access is only in omap3_evm_get_revision() which in turn only > gets called in misc_init_r(), i. e. after relocation. > > Read access is only in get_omap3_evm_rev() [which is not called > outside this file and thus should be made static!] which gets called > only in omap3_evm_need_extvbus() which gets acalled only in > musb_platform_init(), i. e. during USB init. > > This should be safe. Alright. > You could try out what happens if you make get_omap3_evm_rev() static... No change: the warning remains, and so do the two segments. Maybe I should subscribe the binutils list and ask there. Meanwhile, this variable could be initialized to some safe value such as OMAP3EVM_BOARD_UNKNOWN. BTW... Why on Earth is it an uint8? Probably a space saving measure, but one I think is not really fruitful, because of probable paddings and alignments; making it an int would allow using smsc_id directly as values for the OMAP3EVM_BOARD_GEN_1 and OMAP3EVM_BOARD_GEN_2... ... plus it removes the linker warning! I thus suggest turning omap3_evm_version from uint8 to int and get on with debugging the board. > Best regards, > > Wolfgang Denk Amicalement, -- Albert.