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

reduce-relocations build broken with binutils 2.35

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.0
    • Build System
    • None
    • openSUSE Tumbleweed
    • 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

            thiago Thiago Macieira
            vogtinator Fabian Vogt
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes