public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: <nickc@redhat.com>
Cc: <binutils@sources.redhat.com>
Subject: Re: stripping symbols needed for relocations
Date: Thu, 14 Oct 2004 08:15:00 -0000	[thread overview]
Message-ID: <s16e439a.027@emea1-mh.id2.novell.com> (raw)

Nick,

>> Wouldn't it make sense to prevent doing such (except when
--strip-all)
>> in the first place (binutils/objcopy.c, filter_symbols) rather than
>> generating an error message (bfd/elf.c,
>> _bfd_elf_symbol_from_bfd_symbol)? Or are there specific uses of
doing so
>> that would not result in such an error?
>
>I think that the only case where it would not matter is if the 
>relocation is in a section which is going to be discarded.  So to
answer 
>your first question, yes I think that filter_symbols() should try to 
>preserve reloc-used symbols unless --strip-all or --strip-symbol is in

>effect.  Note that the code does already try to do this by looking for

>the BSF_KEEP flag.

The --strip-all case is out of question, but my concern is primarily
with the combination of --strip-symbol/--strip-symbols and -w, but to
some degree also with the plain use of --strip-symbol/--strip-symbols:
When trying to cut down the number of symbols in the linux kernel
(subject to kallsyms lookup) I'm trying to eliminate all non-text
symbols. Finding them is not a problem, but filtering out those used in
relocations is, which is why I'd want objcopy to do this for me. Since
I'm of the general opinion that --strip-symbol for symbols used in
relocations for non-discarded sections (which I would hope already don't
get the BSF_KEEP flag set) will result in a broken output file, I'd like
to make objcopy smart enough to deal with that situation (possibly
through a new option --keep-needed or --force-strip-needed, depending on
what the desirable default would be and whether keeping the current
behavior is a requirement).

Jan

             reply	other threads:[~2004-10-14  8:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-14  8:15 Jan Beulich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-12-16 13:18 Jan Beulich
2004-12-16 14:20 ` Dave Korn
2004-12-16 15:48 ` Nick Clifton
2004-12-15 15:51 Jan Beulich
2004-12-16 12:07 ` Nick Clifton
     [not found] <s16e439a.026@emea1-mh.id2.novell.com>
2004-10-18 14:19 ` Nick Clifton
2004-10-11 11:48 Jan Beulich
2004-10-13 15:57 ` Nick Clifton

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=s16e439a.027@emea1-mh.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=binutils@sources.redhat.com \
    --cc=nickc@redhat.com \
    /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).