public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Nick Clifton <nickc@redhat.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: RFC: GAS: Add option to generate unused section symbols
Date: Fri, 4 Mar 2022 08:05:16 -0800	[thread overview]
Message-ID: <CAMe9rOrTcs-a0YXoTkKZzQeKwgeGw6_9eyvLDN2uhvKRUky2Lw@mail.gmail.com> (raw)
In-Reply-To: <87czj1vhlf.fsf@redhat.com>

On Fri, Mar 4, 2022 at 7:54 AM Nick Clifton via Binutils
<binutils@sourceware.org> wrote:
>
> Hi Guys,
>
>   With the 2.36 release of the binutils we stopped generating section
>   symbols if they were not needed by relocations.  This helps to reduce
>   object file size and enhances compatibility with the LLVM compiler.
>   But I have received some bug reports about this feature, most notably
>   from kernel maintainers who have found that the new behaviour breaks
>   the recordmcount tool.  So I am proposing the attached patch as a

I ran into this problem in the Linux kernel build.   I believe the proper
solution is to change the Linux kernel not to include the .o files which
are empty and unused.  It isn't so hard to do.

>   solution.
>
>   The patch adds an option to the assembler: --keep-unused-section-symbols=[yes|no]
>   which is pretty much self describing.  The patch itself is fairly
>   simple, although there is one area that might provoke comment:  Since
>   the xvec structure in a BFD is accessed via a const pointer, its
>   contents cannot be changed.  This makes sense most of the time, but
>   poses a problem for this patch since it wants to change the
>   keep_unused_section_symbols field.  So I decided that the simplest way
>   to resolve this would be to allocate a new xvec structure, fill it in,
>   and then change the pointer in the bfd.  This might be a bit wasteful
>   of memory, but I am not expecting this feature to be used very often
>   and I thought that it was better to preserve the const pointer
>   semantics.
>
>   Any comments ?
>
> Cheers
>   Nick


-- 
H.J.

  reply	other threads:[~2022-03-04 16:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 15:54 Nick Clifton
2022-03-04 16:05 ` H.J. Lu [this message]
2022-03-04 16:19 ` Michael Matz
2022-03-07 12:32   ` 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=CAMe9rOrTcs-a0YXoTkKZzQeKwgeGw6_9eyvLDN2uhvKRUky2Lw@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --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).