From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31737 invoked by alias); 17 May 2006 11:05:49 -0000 Received: (qmail 31729 invoked by uid 22791); 17 May 2006 11:05:49 -0000 X-Spam-Check-By: sourceware.org Received: from web26907.mail.ukl.yahoo.com (HELO web26907.mail.ukl.yahoo.com) (217.146.176.96) by sourceware.org (qpsmtpd/0.31) with SMTP; Wed, 17 May 2006 11:05:46 +0000 Received: (qmail 17894 invoked by uid 60001); 17 May 2006 11:03:43 -0000 Message-ID: <20060517110343.17891.qmail@web26907.mail.ukl.yahoo.com> Received: from [80.168.43.100] by web26907.mail.ukl.yahoo.com via HTTP; Wed, 17 May 2006 13:03:43 CEST Date: Wed, 17 May 2006 16:19:00 -0000 From: Etienne Lorrain Subject: Re: `.sym' referenced in section `reloc_sym' of file.o: defined in discarded section `.text.sym' of file.o To: Alan Modra Cc: binutils@sourceware.org In-Reply-To: <20060517003519.GJ19700@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00290.txt.bz2 --- Alan Modra wrote: > It's special because it is non-alloc, non-load. --gc-sections does not > remove such sections, but does not treat their relocs specially. > ie. unless reloc_paramcode_section is itself referenced from somewhere, > its relocs will not be examined to see whether other sections referenced > by it should be kept. > > See http://sources.redhat.com/ml/binutils/2004-08/msg00178.html Perhaps > I should have restricted that change to sections without relocs. That > would still keep sections like .comment and .note.GNU-stack, but drop > your "special" section. I'm applying the following: > > * elflink.c (elf_gc_sweep): Don't specially keep non-alloc, > non-load sections if they have relocs. > > Index: bfd/elflink.c > =================================================================== > RCS file: /cvs/src/src/bfd/elflink.c,v > retrieving revision 1.213 > diff -u -p -r1.213 elflink.c > --- bfd/elflink.c 11 May 2006 15:55:40 -0000 1.213 > +++ bfd/elflink.c 17 May 2006 00:28:23 -0000 > @@ -8965,7 +8965,7 @@ elf_gc_sweep (bfd *abfd, struct bfd_link > { > /* Keep debug and special sections. */ > if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0 > - || (o->flags & (SEC_ALLOC | SEC_LOAD)) == 0) > + || (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0) > o->gc_mark = 1; > > if (o->gc_mark) Thanks, that works: /home/etienne/projet/toolchain/bin/ld boot.o user.o debug.o library.o disk.o util.o gzlib.o kbd.o fs.o vmlinuz.o mouse.o main.o font.o -nostdlib -Tboot.lnk -Map=boot.map --sort-common --cref --warn-section-align --no-check-sections --gc-sections -o boot.elf /home/etienne/projet/toolchain/bin/ld: warning: no memory region specified for loadable section `.rel.dyn' /home/etienne/projet/toolchain/bin/objcopy --output-target=binary boot.elf boot.bin > > ld: error: no memory region specified for loadable section `.rel.dyn' Looks like that is now a warning - I do not understand why. Someone on the list plans to remove the warning if the section is empty, or shall I create a dummy? Thanks again, Etienne. ___________________________________________________________________________ Faites de Yahoo! votre page d'accueil sur le web pour retrouver directement vos services préférés : vérifiez vos nouveaux mails, lancez vos recherches et suivez l'actualité en temps réel. Rendez-vous sur http://fr.yahoo.com/set