glibc/sysdeps
Alexey Neyman d40dbe722f sh: Fix building with gcc5/6
Build glibc for sh4-unknown-linux-gnu currently fails if one's
using GCC5/6: in dl-conflict.c, the elf_machine_rela() function
is called with NULL as its 3rd argument, sym. The implementation
of that function in sysdeps/sh/dl-machine.h dereferences that pointer:

const Elf32_Sym *const refsym = sym;
...
if (map == &GL(dl_rtld_map))
  value -= map->l_addr + refsym->st_value + reloc->r_addend;

GCC discovers a null pointer dereference, and in accordance with
-fdelete-null-pointer-checks (which is enabled in -O2) replaces this
code with a trap - which, as SH does not implement a trap pattern in
GCC, evaluates to an abort() call. This abort() call pulls many more
objects from libc_nonshared.a, eventually resulting in link failure
due to multiple definitions for a number of symbols.

As far as I see, the conditional before this code is always false in
rtld: _dl_resolve_conflicts() is called with main_map as the first
argument, not GL(_dl_rtld_map), but since that call is in yet another
compilation unit, GCC does not know about it. Patch that wraps this
conditional into !defined RESOLVE_CONFLICT_FIND_MAP attached.

	* sysdeps/sh/dl-machine.h (elf_machine_rela): The condition
	in R_SH_DIR32 case is always false when inlined from
	dl-conflict.c. Ifdef out to prevent GCC from insertin an
	abort() call.
2017-03-12 17:29:32 -03:00
..
aarch64 New pthread rwlock that is more scalable. 2017-01-10 11:50:17 +01:00
alpha alpha: Use saturating arithmetic in memchr 2017-02-01 14:39:04 -08:00
arm Update arm, mips, powerpc-nofpu libm-test-ulps. 2017-02-17 23:10:01 +00:00
generic Ignore and remove LD_HWCAP_MASK for AT_SECURE programs (bug #21209) 2017-03-07 20:52:04 +05:30
gnu Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
hppa Remove very old libm-test-ulps entries. 2017-01-20 23:58:49 +00:00
i386 Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
ia64 Allow direct use of math_ldbl.h in testsuite. 2017-02-25 10:40:48 -05:00
ieee754 Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
init_array Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
m68k m68k: fix 64bit atomic ops 2017-02-01 01:32:31 +01:00
mach hurd: Provide truncate64 and ftruncate64. 2017-03-04 14:25:49 +01:00
microblaze Remove very old libm-test-ulps entries. 2017-01-20 23:58:49 +00:00
mips Regenerate MIPS catan, catanh long double ulps. 2017-03-09 22:37:47 +00:00
nacl Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
nios2 New pthread rwlock that is more scalable. 2017-01-10 11:50:17 +01:00
nptl Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
posix timezone: Remove TZNAME_MAX limit from sysconf [BZ #15576] 2017-03-07 17:45:38 +01:00
powerpc Miscellaneous low-risk changes preparing for _ISOMAC testsuite. 2017-03-01 20:32:50 -05:00
pthread Refer to <signal.h> instead of <pthread.h> in <bits/sigthread.h> 2017-02-28 10:34:15 +01:00
s390 Update auto-libm-test-out for catan / catanh. 2017-03-10 08:45:29 +01:00
sh sh: Fix building with gcc5/6 2017-03-12 17:29:32 -03:00
sparc sparc: Remove optimized math routines which cause testsuite failures. 2017-02-03 17:55:25 -08:00
tile tile: Check for pointer add overflow in memchr 2017-01-16 15:44:48 -05:00
unix Fix send consolidation typo 2017-03-12 17:25:00 -03:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wordsize-64 Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
x86 Use index_cpu_RTM and reg_RTM to clear the bit_cpu_RTM bit 2017-02-17 11:53:26 -08:00
x86_64 Document and fix --enable-bind-now [BZ #21015] 2017-03-02 14:44:28 +01:00