Re: change in -fpic handling?

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

 



On 06/26/2018 02:53 PM, Dave Love wrote:
What has changed in the last month to affect building shared libraries
in rawhide?

I tried to rebuild libxsmm in rawhide, after changing the spec to use
python2 explicitly, and it failed with

   /usr/bin/ld: build/intel64/libxsmm_main.o: relocation R_X86_64_PC32 against symbol `libxsmm_crc32_u64' can not be used when making a shared object; recompile with -fPIC

The sources are compiled with -fpic and it's x86_64 only, so -fPIC
v. -fpic shouldn't matter as I understand it.

It's related to annobin. libxsmm_crc32_u64 is a static function with a target attribute, and the sources are compiled with -ffunction-sections.

GCC emits calls to the function using:

        call    libxsmm_crc32_u64

This is a direct call, not through the PLT, and is allowed under the default x86-64 memory model for local (static) functions because all code fits into 2 GiB.

But annobin generates this:

        .pushsection .text.libxsmm_crc32_u64
libxsmm_crc32_u64_end:
        .popsection
        .pushsection .gnu.build.attributes
        .weak libxsmm_crc32_u64
        .weak libxsmm_crc32_u64_end
        .popsection

The .weak directive makes the symbol global, so it can be interposed from other modules, and the direct call shown above is no longer permitted.

Nick, this looks like an annobin bug. This is really, really problematic from an ABI perspective.

Thanks,
Florian
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx/message/6MBGRPJOGWHQEV3Z3FBZSBKJADTSDS3G/




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux