public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Etienne Lorrain <etienne_lorrain@yahoo.fr>
To: Alan Modra <amodra@bigpond.net.au>
Cc: binutils@sourceware.org
Subject: Re: `.sym' referenced in section `reloc_sym' of file.o: defined in discarded section `.text.sym' of file.o
Date: Wed, 17 May 2006 16:19:00 -0000	[thread overview]
Message-ID: <20060517110343.17891.qmail@web26907.mail.ukl.yahoo.com> (raw)
In-Reply-To: <20060517003519.GJ19700@bubble.grove.modra.org>

--- 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

  parent reply	other threads:[~2006-05-17 11:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-16 15:28 Etienne Lorrain
2006-05-16 22:39 ` Alan Modra
2006-05-16 22:47   ` Etienne Lorrain
2006-05-17 11:34     ` Alan Modra
2006-05-17 15:32       ` Fix regression introduced 2006-04-21 Alan Modra
2006-05-17 16:19       ` Etienne Lorrain [this message]
2006-05-19 11:50         ` `.sym' referenced in section `reloc_sym' of file.o: defined in discarded section `.text.sym' of file.o Alan Modra
2006-05-19 15:30           ` Etienne Lorrain
2006-05-19 15:37           ` Alan Modra
2006-05-19 15:57           ` Etienne Lorrain
2006-05-20 13:56             ` Alan Modra
2006-05-16 22:37 Etienne Lorrain

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=20060517110343.17891.qmail@web26907.mail.ukl.yahoo.com \
    --to=etienne_lorrain@yahoo.fr \
    --cc=amodra@bigpond.net.au \
    --cc=binutils@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).