public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] Switch from archive libraries to partial linking
Date: Thu, 18 Nov 2010 23:08:49 +0100	[thread overview]
Message-ID: <4CE5A3F1.50304@free.fr> (raw)
In-Reply-To: <20101118214448.B8DC014EA7E@gemini.denx.de>

Le 18/11/2010 22:44, Wolfgang Denk a ?crit :
> Dear Sebastien Carlier,
>
> In message<20101117133056.GB23875@safe.home.local>  you wrote:
>>
>>> MPC8xx boards break with long lists of multiple definitions of
>>> symbols, like that:
>>>
>>> Configuring for FPS860L board...
>>> lib/libgeneric.o: In function `vsprintf':
>>> /home/wd/git/u-boot/work/lib/vsprintf.c:480: multiple definition of `vsprintf'
>>> ...
>>>
>>> Have you seen that, too?
>>
>> Unfortunately I have not been able to reproduce these errors with the
>> toolchain I am using (gcc 4.4.5 and binutils 2.20.1.20100303, based on
>> emdebian squeeze packages).  Can you please point me to the toolchain
>> you are using?
>
> Are you sure this doesn't happen with your tool chain?
>
> I found out why this happens, and I think the effect should be
> independent of the used tool chain:
>
> For example, in "board/tqc/tqm8xx/u-boot.lds" we arrange to have the
> environment located in one of the "small" NOR flash sectors:
>
> ....
>   53   .text      :
>   54   {
>   55     /* WARNING - the following is hand-optimized to fit within  */
>   56     /* the sector layout of our flash chips!    XXX FIXME XXX   */
>   57
>   58     arch/powerpc/cpu/mpc8xx/start.o             (.text)
>   59     arch/powerpc/cpu/mpc8xx/traps.o             (.text)
>   60     common/dlmalloc.o           (.text)
>   61     arch/powerpc/lib/ppcstring.o                (.text)
>   62     lib/vsprintf.o      (.text)
>   63     lib/crc32.o         (.text)
>   64     lib/zlib.o          (.text)
>   65     arch/powerpc/lib/cache.o            (.text)
>   66
>   67     . = DEFINED(env_offset) ? env_offset : .;
>   68     common/env_embedded.o       (.ppcenv)
>   69
>   70     *(.text)
>   71     *(.got1)
> ....
>
> That means, the linker script pulls in certain object files directly.
> Before, when linking with libraries, this was no problem, as the
> linker would pull only (so far) unresolved symbols from the libraries
> specified on the command line.  Now, we include these individual
> object files through the linker script, and then again when specifying
> the "library" objects on the command line - which necessarily results
> in "multiple definition" errors.

Are you sure of this? From 
<http://sourceware.org/binutils/docs-2.20/ld/Input-Section-Basics.html#Input-Section-Basics>, 
specifying a file name in the linker file *and* on the command line 
should not lead to a double inclusion of the object file:

"When you use a file name which is not an `archive:file' specifier and 
does not contain any wild card characters, the linker will first see if 
you also specified the file name on the linker command line or in an 
INPUT command. If you did not, the linker will attempt to open the file 
as an input file, as though it appeared on the command line."

> Unfortunately I don't know how to solve this yet.  Does anybody know of
> a way how to manually arrange the objects (or symbols) in the linked
> image?
>
>
> Best regards,
>
> Wolfgang Denk

Amicalement,
-- 
Albert.

  reply	other threads:[~2010-11-18 22:08 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-08 22:04 [U-Boot] [PATCH] Switch from archive libraries to partial linking Sebastien Carlier
2010-11-08 22:10 ` Graeme Russ
2010-11-08 22:34   ` Sebastien Carlier
2010-11-09  6:17 ` Andreas Bießmann
2010-11-09  9:15 ` Andre Schwarz
2010-11-09 17:44   ` [U-Boot] [PATCH v2] " Sebastien Carlier
2010-11-10  8:35     ` Andre Schwarz
2010-11-09  9:48 ` [U-Boot] [PATCH] " Graeme Russ
2010-11-09 11:29 ` Stefano Babic
2010-11-10  6:57 ` Mike Frysinger
2010-11-10  8:01   ` Andreas Bießmann
2010-11-10  8:07   ` [U-Boot] [PATCH v3] " Sebastien Carlier
2010-11-10  8:55     ` Mike Frysinger
2010-11-10 12:24       ` Sebastien Carlier
2010-11-10 21:07         ` Mike Frysinger
2010-11-15  7:51     ` Wolfgang Denk
2010-11-15  8:09       ` Sebastien Carlier
2010-11-15 10:54         ` Wolfgang Denk
2010-11-15 11:33           ` Mike Frysinger
2010-11-15 12:38             ` Mike Frysinger
2010-11-15 12:42               ` Mike Frysinger
2010-11-15 12:52               ` Mike Frysinger
2010-11-15 11:35           ` [U-Boot] [PATCH v4] " Sebastien Carlier
2010-11-15 12:13           ` Sebastien Carlier
2010-11-15 12:39             ` Mike Frysinger
2010-11-16 14:58               ` Detlev Zundel
2010-11-16 16:33                 ` Mike Frysinger
2010-11-17 12:30                   ` Detlev Zundel
2010-11-17 13:30           ` [U-Boot] [PATCH v3] " Sebastien Carlier
2010-11-17 13:50             ` Wolfgang Denk
2010-11-17 18:06             ` Mike Frysinger
2010-11-17 19:53               ` Sebastien Carlier
2010-11-17 22:19                 ` Mike Frysinger
2010-11-18 21:44             ` Wolfgang Denk
2010-11-18 22:08               ` Albert ARIBAUD [this message]
2010-11-18 22:33                 ` Wolfgang Denk
2010-11-19  6:36                   ` Albert ARIBAUD
2010-11-19  8:03                     ` Wolfgang Denk
2010-11-20  0:07                       ` Mike Frysinger
2010-11-20  8:38                         ` Wolfgang Denk
2010-11-20  8:48                           ` Albert ARIBAUD
2010-11-20  9:19                           ` Mike Frysinger
2010-11-19  8:04                     ` Sebastien Carlier
2010-11-19  7:50               ` Sebastien Carlier
2010-11-19  8:08                 ` Wolfgang Denk
2010-11-19  8:34                   ` Sebastien Carlier
2010-11-19 11:11                     ` Wolfgang Denk
2010-11-19 11:40                       ` Albert ARIBAUD
2010-11-19 11:48                         ` Wolfgang Denk
2010-11-19 12:11                           ` Albert ARIBAUD
2010-11-19 12:33                       ` Sebastien Carlier
2010-11-19 12:38                         ` Albert ARIBAUD
2010-11-19 13:02                           ` Sebastien Carlier
2010-11-19 13:07                             ` Reinhard Meyer
2010-11-19 13:33                               ` Albert ARIBAUD
2010-11-19 13:40                               ` Wolfgang Denk
2010-11-19 12:55                         ` Wolfgang Denk
2010-11-19  8:10                 ` Mike Frysinger
2010-11-15 19:44         ` Mike Frysinger
2010-11-15 11:44 ` [U-Boot] [PATCH] " Mike Frysinger
2011-01-24 20:54 ` Timur Tabi
2011-01-25  0:03   ` Kumar Gala
2011-01-25  6:36     ` Wolfgang Denk
2011-01-25  8:55       ` Kumar Gala
2011-01-25 16:40         ` Timur Tabi
2011-01-25 17:49           ` Kumar Gala
2011-01-25 18:30             ` Timur Tabi
2011-01-25 19:02               ` Wolfgang Denk
2011-01-25 20:05             ` Scott Wood
2011-01-25 20:19               ` Wolfgang Denk
2011-01-25 20:37                 ` Scott Wood
2011-01-25 21:13                   ` Wolfgang Denk
2011-01-26  5:22                     ` Kumar Gala
2011-01-26 17:26                       ` Scott Wood
2011-01-25 18:27           ` Wolfgang Denk
2011-01-25 18:29             ` Timur Tabi
2011-01-25 18:54               ` Wolfgang Denk
2011-01-25 18:57                 ` Timur Tabi
2011-01-25 19:05                   ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CE5A3F1.50304@free.fr \
    --to=albert.aribaud@free.fr \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox