[U-Boot] [PATCH v3] Switch from archive libraries to partial linking

Wolfgang Denk wd at denx.de
Sat Nov 20 09:38:44 CET 2010


Dear Mike Frysinger,

In message <201011191908.00162.vapier at gentoo.org> you wrote:
>
> the difference is that the linker wont bother looking at the duplicated 
> objects in the archives.  from the linker's perspective though, we now have to 
> completely independent objects.  the combined one specified on the command
> line and the split up ones in the linker script.

Right.

> one possible way to fix boards is to stop specifying sub-objects in the linker 
> script and only specify the combined ones.  so in board/tqc/tqm8xx/u-boot.lds, 
> drop the split objects like lib/zlib.o in favor of the combined one like 
> lib/libgeneric.o.  this might not work for everyone since the combined object 

It doesn't work as we cannot fine-adjust the size of the combined
objects as it's needed for at least coarse adjustment to the available
flash sector sizes.

> sizes can be a bit large.  if everyone was using -ffunction-sections/-fdata-
> sections 

?  Could you please complete that sentence?

> this however wont work for common/env_embedded.o since it is merged 
> common/libcommon.o.  so to fix that, we'll need to not merge env_embedded.o
> into libcommon.o.  like in the patch below.
> -mike
>
> diff --git a/common/Makefile b/common/Makefile
> index e0db382..d38aa7b 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -52,10 +52,10 @@ COBJS-y += cmd_version.o
>  COBJS-y += env_common.o
>  COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
>  COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
> -COBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
> -COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
> -COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
> -COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
> +XOBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
> +XOBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
> +XOBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
> +XOBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
>  COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
>  COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
>  COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o

Is this not too much? We have embedded environment only in the case
of NOR flash, so the extra handling should only be done for
CONFIG_ENV_IS_EMBEDDED ?

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
The perversity of nature is nowhere better demonstrated by  the  fact
that,  when  exposed to the same atmosphere, bread becomes hard while
crackers become soft.


More information about the U-Boot mailing list