diff options
author | Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> | 2017-07-17 17:48:59 -0300 |
---|---|---|
committer | Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com> | 2017-07-17 17:49:26 -0300 |
commit | 91ac3a7d8474480685632cd25f844d3154c69fdf (patch) | |
tree | e83a0146b14a08bafb9b9d5a25d83f7c715b266c /sysdeps/powerpc/powerpc64le | |
parent | ae5c498d93d049d9574d3f8f18e62cac64cbdf5c (diff) | |
download | glibc-91ac3a7d8474480685632cd25f844d3154c69fdf.zip glibc-91ac3a7d8474480685632cd25f844d3154c69fdf.tar.gz glibc-91ac3a7d8474480685632cd25f844d3154c69fdf.tar.bz2 |
powerpc: Fix float128 IFUNC relocations [BZ #21707]
The patch proposed by Peter Bergner [1] to libgcc in order to fix
[BZ #21707] adds a dependency on a symbol provided by the loader,
forcing the loader to be linked to tests after libgcc was linked.
It also requires to read the thread pointer during IRELA relocations.
Tested on powerpc, powerpc64, powerpc64le, s390x and x86_64.
[1] https://sourceware.org/ml/libc-alpha/2017-06/msg01383.html
[BZ #21707]
* csu/libc-start.c (LIBC_START_MAIN): Perform IREL{,A}
relocations before or after initializing the TCB on statically
linked executables. That's a per-architecture definition.
* elf/rtld.c (dl_main): Add a comment about thread-local
variables initialization.
* sysdeps/generic/libc-start.h: New file. Define
ARCH_APPLY_IREL and ARCH_SETUP_IREL.
* sysdeps/powerpc/Makefile:
[$(subdir) = elf && $(multi-arch) != no] (tests-static-internal): Add tst-tlsifunc-static.
[$(subdir) = elf && $(multi-arch) != no && $(build-shared) == yes]
(tests-internal): Add tst-tlsifunc.
* sysdeps/powerpc/tst-tlsifunc.c: New file.
* sysdeps/powerpc/tst-tlsifunc-static.c: Likewise.
* sysdeps/powerpc/powerpc64le/Makefile (f128-loader-link): New
variable.
[$(subdir) = math] (test-float128% test-ifloat128%): Force
linking to the loader after linking to libgcc.
[$(subdir) = wcsmbs || $(subdir) = stdlib] (bug-strtod bug-strtod2)
(bug-strtod2 tst-strtod-round tst-wcstod-round tst-strtod6 tst-strrom)
(tst-strfrom-locale strfrom-skeleton): Likewise.
* sysdeps/unix/sysv/linux/powerpc/libc-start.h: New file. Define
ARCH_APPLY_IREL and ARCH_SETUP_IREL.
Diffstat (limited to 'sysdeps/powerpc/powerpc64le')
-rw-r--r-- | sysdeps/powerpc/powerpc64le/Makefile | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerpc64le/Makefile index 2c34f38..77617b6 100644 --- a/sysdeps/powerpc/powerpc64le/Makefile +++ b/sysdeps/powerpc/powerpc64le/Makefile @@ -1,6 +1,11 @@ # When building float128 we need to ensure -mfloat128 is # passed to all such object files. +# libgcc requires __tcb_parse_hwcap_and_convert_at_platform when built with +# a binary128 type. That symbol is provided by the loader on dynamically +# linked executables, forcing to link the loader after libgcc link. +f128-loader-link = $(as-needed) $(elf-objpfx)ld.so $(no-as-needed) + ifeq ($(subdir),math) # sqrtf128 requires emulation before POWER9. CPPFLAGS += -I../soft-fp @@ -11,6 +16,8 @@ $(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += -mfloat128 $(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -mfloat128 $(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFLAGS += -mfloat128 CFLAGS-libm-test-support-float128.c += -mfloat128 +$(objpfx)test-float128% $(objpfx)test-ifloat128%: \ + gnulib-tests += $(f128-loader-link) endif # Append flags to string <-> _Float128 routines. @@ -28,6 +35,9 @@ CFLAGS-tst-strtod6.c += -mfloat128 CFLAGS-tst-strfrom.c += -mfloat128 CFLAGS-tst-strfrom-locale.c += -mfloat128 CFLAGS-strfrom-skeleton.c += -mfloat128 +$(foreach test,bug-strtod bug-strtod2 bug-strtod2 tst-strtod-round \ +tst-wcstod-round tst-strtod6 tst-strrom tst-strfrom-locale \ +strfrom-skeleton,$(objpfx)$(test)): gnulib-tests += $(f128-loader-link) # When building glibc with support for _Float128, the powers of ten tables in # fpioconst.c and in the string conversion functions must be extended. Some |