bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/26980] Report "version node not found for symbol" for an executa


From: hjl.tools at gmail dot com
Subject: [Bug ld/26980] Report "version node not found for symbol" for an executable
Date: Tue, 01 Dec 2020 13:08:26 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26980

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
It is done on purpose:

      /* If we are building an application, we need to create a
         version node for this version.  */
      if (t == NULL && bfd_link_executable (info))
        {
          struct bfd_elf_version_tree **pp;
          int version_index;

          /* If we aren't going to export this symbol, we don't need
             to worry about it.  */
          if (h->dynindx == -1)
            return TRUE;

          t = (struct bfd_elf_version_tree *) bfd_zalloc (info->output_bfd,
                                                          sizeof *t);
          if (t == NULL)
            {
              sinfo->failed = TRUE;
              return FALSE;
            }

          t->name = p;
          t->name_indx = (unsigned int) -1;
          t->used = TRUE;

          version_index = 1;
          /* Don't count anonymous version tag.  */
          if (sinfo->info->version_info != NULL
              && sinfo->info->version_info->vernum == 0)
            version_index = 0;
          for (pp = &sinfo->info->version_info;
               *pp != NULL;
               pp = &(*pp)->next)
            ++version_index;
          t->vernum = version_index;

          *pp = t;

          h->verinfo.vertree = t;
        }
      else if (t == NULL)
        {
          /* We could not find the version for a symbol when
             generating a shared archive.  Return an error.  */
          _bfd_error_handler
            /* xgettext:c-format */
            (_("%pB: version node not found for symbol %s"),
             info->output_bfd, h->root.root.string);
          bfd_set_error (bfd_error_bad_value);
          sinfo->failed = TRUE;
          return FALSE;
        }
    }:

Linker version script isn't required for executables:

'--version-script=VERSION-SCRIPTFILE'
     Specify the name of a version script to the linker.  This is
     typically used when creating shared libraries to specify additional
     information about the version hierarchy for the library being
     created.  This option is only fully supported on ELF platforms
     which support shared libraries; see *note VERSION::.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]