bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/15056] gld 2.23.1 mishandles R_SPARC_TLS_LDM_CALL


From: amodra at gmail dot com
Subject: [Bug ld/15056] gld 2.23.1 mishandles R_SPARC_TLS_LDM_CALL
Date: Thu, 31 Jan 2013 04:03:49 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=15056

--- Comment #12 from Alan Modra <amodra at gmail dot com> 2013-01-31 04:03:49 
UTC ---
So there's no need for gc_mark_hook to return the section of the symbol on the
R_SPARC_TLS_GD_CALL?  ie. you're sure that section will be marked from some
other reloc?  If not then something like the following is needed.

  if (info->shared)
    switch (SPARC_ELF_R_TYPE (rel->r_info))
      {
      case R_SPARC_TLS_GD_CALL:
      case R_SPARC_TLS_LDM_CALL:
    tga = elf_link_hash_lookup (elf_hash_table (info), "__tls_get_addr",
                    FALSE, FALSE, TRUE);
    BFD_ASSERT (tga != NULL);
    tga->mark = 1;
    if (tga->u.weakdef != NULL)
      tga->u.weakdef->mark = 1;
    /* If __tls_get_addr might ever have a regular definition,
       then we need to mark its section too.  */
    rsec = _bfd_elf_gc_mark_hook (sec, info, rel, tga, NULL);
    if (rsec && !rsec->gc_mark)
      {
        if (bfd_get_flavour (rsec->owner) != bfd_target_elf_flavour
        || (rsec->owner->flags & DYNAMIC) != 0)
          rsec->gc_mark = 1;
        else
          /* FIXME: return error from _bfd_elf_gc_mark somehow.  */
          _bfd_elf_gc_mark (info, rsec, _bfd_sparc_elf_gc_mark_hook);
      }
      }

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]