[PATCH] PR ld/19317: ld -r doesn't need plugin for slim lto object

H.J. Lu hjl.tools@gmail.com
Thu Dec 10 20:42:00 GMT 2015


On Thu, Dec 10, 2015 at 8:21 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Plugin isn't required on slim lto object for relocatable link.
>
> OK for master?
>
> H.J.
> ---
> bfd/
>
>         PR ld/19317
>         * linker.c (_bfd_generic_link_add_one_symbol): Don't complain
>         plugin needed to handle slim lto object for relocatable link.
>
> ld/testsuite/
>
>         PR ld/19317
>         * ld-plugin/lto.exp (lto_no_fat): New.
>         (run_ld_link_tests): Likewise.
>         (lto_link_tests): Add a test for PR ld/19317.
>         (lto_run_tests): Likewise.
> ---
>  bfd/linker.c                       |  3 ++-
>  ld/testsuite/ld-plugin/lto.exp     | 14 ++++++++++++++
>  ld/testsuite/ld-plugin/pr19317.c   |  8 ++++++++
>  ld/testsuite/ld-plugin/pr19317.out |  1 +
>  4 files changed, 25 insertions(+), 1 deletion(-)
>  create mode 100644 ld/testsuite/ld-plugin/pr19317.c
>  create mode 100644 ld/testsuite/ld-plugin/pr19317.out
>
> diff --git a/bfd/linker.c b/bfd/linker.c
> index 86a7a19..6c59102 100644
> --- a/bfd/linker.c
> +++ b/bfd/linker.c
> @@ -1475,7 +1475,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
>    else if (bfd_is_com_section (section))
>      {
>        row = COMMON_ROW;
> -      if (strcmp (name, "__gnu_lto_slim") == 0)
> +      if (!bfd_link_relocatable (info)
> +         && strcmp (name, "__gnu_lto_slim") == 0)
>         (*_bfd_error_handler)
>           (_("%s: plugin needed to handle lto object"),
>            bfd_get_filename (abfd));

This is what I checked in.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ld-r-doesn-t-need-plugin-for-slim-lto-object.patch
Type: text/x-patch
Size: 3447 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20151210/248d9f8b/attachment.bin>


More information about the Binutils mailing list