public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Howard Chu <hyc@symas.com>
Cc: binutils@sourceware.org
Subject: Re: dependency list for static libraries
Date: Tue, 22 Sep 2020 11:39:05 +0100	[thread overview]
Message-ID: <9889c54b-4dd3-2275-6621-c2391cfd268d@redhat.com> (raw)
In-Reply-To: <e0c00779-d9e4-100a-6cb3-72b535d9e572@symas.com>

Hi Howard,

> Here's a proposed patch to ar to implement the first half of the solution:
> storing the dependencies into a static library.

Some comments on the patch:

  * You need to add documentation of the new feature to binutils/doc/bin.texi
    and also a note to binutils/NEWS.

  * Whilst single letter options are the convention for ar, it would also be
    good if the GNU convention of providing a more verbose alternative option
    name were used to.  Eg --record-libdeps=<string>.

    Whilst on the subject of options, you should add some error checking for
    the presence of multiple L options.

  * There are several places where you call bfd library functions but do not
    check the return values.  This is a bad idea.  Always be paranoid and
    check to ensure that a function call has succeeded.

  * It is not clear to me why you create a binary bfd for Libdeps_bfd but
    then convert it to a plugin type bfd.  Can you explain what you are
    doing here ?

  * The change to the code to call ar_emul_replace() inside replace_members()
    looks wrong to me.  The current code will try to replace all of the entries
    on the files_to_move list, and will set changed to TRUE if any of the
    replacements succeeds.  The patched code will changed to FALSE if any
    replacement fails, even if earlier ones succeeded.  Plus once one 
    replacement has failed, future successful replacements will not be removed 
    from the archive chain.

  * There are some formatting issues as well. These are minor, but it is 
    helpful to ensure that the codebase uses a uniform style.  Please check
    out the GNU Coding Standards for more information:

      https://www.gnu.org/prep/standards/standards.html

   * It would also be really helpful if you could create a test for the
     binutils testsuite that checks this new functionality.


> It looks like I may be able
> to use the linker plugin facility to handle the ld side of things. But it's
> not clear to me that it won't clash with other plugins. I.e., if one plugin
> claims an archive file, will that prevent other plugins from being able to
> process it?

I am not sure that this has been done before, but I think that you are right -
once a file/archive has been claimed by one plugin, it cannot be claimed by
another.  It may however be possible for your plugin to process an archive
but not claim it.  This is just an idea - I have not tested it - and it might
mean that the ordering of plugins on the command line becomes important...

Cheers
  Nick



  reply	other threads:[~2020-09-22 10:39 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 15:49 Howard Chu
2017-09-19 15:52 ` Simon Richter
     [not found]   ` <WM!bae999665f49907786872b93f01ac98d53e7b97e29b4228399d8baadf9ec0ab33db74467d73c998225b250ba1d00a4c0!@mailstronghold-3.zmailcloud.com>
2017-09-19 16:04     ` Howard Chu
2017-09-20  1:42       ` R0b0t1
2017-09-19 16:54 ` Joseph Myers
     [not found]   ` <WM!83b6ad7285aa96ce69fcd1944d4eae8f20e5f19dfbf161f45313f5393bcffe1b77231520b8f4e24145a3f85eeafb39ed!@mailstronghold-1.zmailcloud.com>
2017-09-19 22:01     ` Howard Chu
2017-09-20  0:20       ` Joseph Myers
2020-09-03 20:42       ` Howard Chu
2020-09-22 10:39         ` Nick Clifton [this message]
2020-09-22 11:42           ` Howard Chu
2020-09-22 13:12             ` Nick Clifton
2020-09-22 16:23               ` [PATCH] " Howard Chu
2020-09-22 17:16                 ` Fangrui Song
2020-09-22 17:55                   ` Howard Chu
2020-09-22 20:46                 ` Howard Chu
2020-09-23 11:52                   ` Nick Clifton
2020-09-23 15:29                     ` Howard Chu
2020-09-24  5:21                       ` Fangrui Song
2020-09-24  9:19                         ` Howard Chu
2020-09-24  9:30                           ` Howard Chu
2020-09-28 11:07                           ` Howard Chu
2020-10-28 14:56                     ` Howard Chu
2020-11-03 15:14                       ` Nick Clifton
2020-11-03 15:31                         ` Howard Chu
2020-11-08  1:39                           ` Alan Modra
2020-11-08 15:07                             ` Howard Chu
2020-11-09  0:01                               ` Alan Modra
2020-11-10  2:44                                 ` Howard Chu
2020-11-10 11:07                                   ` Alan Modra
2020-11-11 14:57                                     ` Howard Chu
2020-11-11 14:59                                       ` Howard Chu
2020-11-17 14:01                                         ` Nick Clifton
2020-11-04  0:33                         ` Howard Chu
2020-11-04 11:01                           ` Nick Clifton
2020-11-04 14:50                             ` Howard Chu
2020-11-06 12:38                               ` Nick Clifton
2020-11-13 14:40                               ` Howard Chu
2020-11-24 17:49                                 ` Howard Chu
2020-11-25 11:17                                   ` Nick Clifton
2020-12-01  0:08                                     ` Howard Chu
2020-12-14 14:28                                       ` Nick Clifton
2020-12-15 16:17                                         ` Jim Wilson
2020-12-15 16:22                                           ` Jeff Law
2020-12-15 16:50                                             ` Nick Clifton
2020-12-15 19:11                                               ` Jeff Law
2020-12-15 20:04                                                 ` Jim Wilson
2020-12-15 20:22                                               ` Cary Coutant
2020-12-15 20:51                                                 ` Howard Chu
2020-12-16 11:16                                                   ` Nick Clifton
2020-12-16 14:49                                                     ` [PATCH] ld: Call plugin hooks only if they are available H.J. Lu
2020-12-16 18:34                                                       ` Howard Chu
2020-12-16 18:40                                                         ` H.J. Lu
2020-12-16 19:06                                                           ` Howard Chu
2020-12-16 19:11                                                             ` [PATCH] ld: Skip libdep plugin if not all plugin hooks " H.J. Lu
2020-12-16 21:26                                                               ` Howard Chu
2020-12-16 21:47                                                                 ` H.J. Lu
2020-12-16 18:44                                                         ` [PATCH] ld: Call plugin hooks only if they " Howard Chu
2020-12-15 20:33                             ` [PATCH] dependency list for static libraries Cary Coutant
2020-12-15 20:53                               ` Howard Chu
2020-12-16 11:18                                 ` Nick Clifton
2020-12-23 13:27                         ` Matthias Klose
2020-12-23 18:23                           ` Howard Chu

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=9889c54b-4dd3-2275-6621-c2391cfd268d@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=hyc@symas.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).