<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - enable-compat-libs requires gold linker"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=75416">75416</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>enable-compat-libs requires gold linker
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stefan.bruens@rwth-aachen.de
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I tried linking the compat libs with the legacy binutils linker. The failing
command (called from libtool) was:

gcc -shared  -fPIC -DPIC  .libs/libsystemd_login_la-libsystemd-login.o  
-Wl,-rpath -Wl,/home/abuild/rpmbuild/BUILD/systemd-209/.libs -Wl,-rpath
-Wl,/usr/lib64 ./.libs/libsystemd.so -L/usr/lib64 -llzma -lgcrypt -lgpg-error
-lrt -lresolv -ldl  -flto -O2 -Wl,--as-needed -Wl,--no-undefined
-Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now
-Wl,--version-script=./src/compat-libs/libsystemd-login.sym   -pthread
-Wl,-soname -Wl,libsystemd-login.so.0 -o .libs/libsystemd-login.so.0.9.2

It fails with:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: 
internal error, aborting at elf64-x86-64.c line 3219 in
elf_x86_64_relocate_section

I have instrumented the abort with some additional output, which prints the
section flags and plt offset:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
.libs/libsystemd_login_la-libsystemd-login.o: Error with relocation
R_X86_64_GOTPCREL against STT_GNU_IFUNC flags: 0x20011f offset
0xffffffffffffffff

Tested binutils 2.23.2 and 2.24.0.

Linking with gold works fine.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>