From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Fri, 19 Nov 2010 07:36:05 +0100 Subject: [U-Boot] [PATCH v3] Switch from archive libraries to partial linking In-Reply-To: <20101118223319.ECB2814E647@gemini.denx.de> References: <1289253872-16891-1-git-send-email-sebastien.carlier@gmail.com> <201011100157.31202.vapier@gentoo.org> <20101110080708.GA8145@safe.home.local> <20101115075129.9C820134FEF@gemini.denx.de> <20101115080950.GA26767@safe.home.local> <20101115105407.2A24714EA7E@gemini.denx.de> <20101117133056.GB23875@safe.home.local> <20101118214448.B8DC014EA7E@gemini.denx.de> <4CE5A3F1.50304@free.fr> <20101118223319.ECB2814E647@gemini.denx.de> Message-ID: <4CE61AD5.50900@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 Le 18/11/2010 23:33, Wolfgang Denk a ?crit : > Dear Albert ARIBAUD, > > In message<4CE5A3F1.50304@free.fr> you wrote: >> >>> 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) > .... >> Are you sure of this? From >> , >> specifying a file name in the linker file *and* on the command line >> should not lead to a double inclusion of the object file: > > I'm sure that I see the errors. > > I see two possible reasons: 1) whay you describe is a new feature in > binutils 2.20; I'm currently using 2.17.50 (with ELDk 4.2); or 2) the > linker does not realize it because it's actually different file names: > for example, vsprintf() gets included in the linker script directly > through lib/vsprintf.o, and throught he command line as > lib/libgeneric.o ==> two different file names. Most probably 2); mentioning a file in the linker script either with or without mentioning it on the command line has certainly been done for some time, so I doubt the feature is new; and certainly the doc is about files, not symbols in different files. And, to get back to possible solutions, I don't know that the linker can map selected symbols onto specific regions; it can only place whole object files. The simplest, though not cleanest, way I can think of is to put conditionals to not compile vsprintf() in lib/generic, and set those conditions from the board config file -- and same for anything else. Ugly, but it will work. A second solution, a bit more intrusive, would be to split lib/generic in two files; a "small" one which could be mapped in the small area, and the rest, which would map with the rest of the image. > Best regards, > > Wolfgang Denk > Amicalement, -- Albert.