Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86173

reduce-relocations build broken with binutils 2.35

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Need More Info
    • Priority: P2: Important
    • Resolution: Incomplete
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: Build System
    • Labels:
      None
    • Environment:
      openSUSE Tumbleweed
    • Platform/s:
      Linux/X11

      Description

      With -reduce-relocations, the shared objects are linked like this:

      -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,.../QtCore.dynlist
      

      This combination results in global symbols being bound internally, but still exported. It breaks when such a library is used with an executable with copy relocations.
      In one case, this happened and was the result of a call to QCoreApplication::instance() getting inlined, accessing the global QCoreApplication::self directly.
      This lead to the executable reading from a different copy of the variable than libQt5Core.so wrote to, causing a nullptr deref.

      This breaks even with binutils 2.34 if -Wl,-Bsymbolic-functions is omitted.

      Downstream bug report: https://bugzilla.opensuse.org/show_bug.cgi?id=1175278
      Binutils bug report: https://sourceware.org/bugzilla/show_bug.cgi?id=26407

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            vogtinator Fabian Vogt
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes