gcc/libsanitizer/sanitizer_common
H.J. Lu 4dfc5b351f libsanitizer: Restore internal_readlink for x32
Cherry-pick compiler-rt revision 354451:

r316591 has

@@ -389,13 +383,11 @@ uptr internal_dup2(int oldfd, int newfd) {
 }

 uptr internal_readlink(const char *path, char *buf, uptr bufsize) {
-#if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
-#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
+#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(readlinkat), AT_FDCWD,
                           (uptr)path, (uptr)buf, bufsize);
 #else
-  return internal_syscall(SYSCALL(readlink), (uptr)path, (uptr)buf, bufsize);
+  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
 #endif
 }

which dropped the (uptr) cast and broke x32.  This patch puts back the
(uptr) cast to restore x32 and fixes:

https://bugs.llvm.org/show_bug.cgi?id=40783

Differential Revision: https://reviews.llvm.org/D58413

	PR sanitizer/89409
	* sanitizer_common/sanitizer_linux.cc (internal_readlink):
	Cherry-pick compiler-rt r354451.

From-SVN: r269042
2019-02-20 08:20:50 -08:00
..
Makefile.am
Makefile.in Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
sancov_begin.S
sancov_end.S
sancov_flags.cc
sancov_flags.h
sancov_flags.inc
sanitizer_addrhashmap.h
sanitizer_allocator_bytemap.h
sanitizer_allocator_checks.cc
sanitizer_allocator_checks.h
sanitizer_allocator_combined.h
sanitizer_allocator_interface.h
sanitizer_allocator_internal.h
sanitizer_allocator_local_cache.h
sanitizer_allocator_primary32.h
sanitizer_allocator_primary64.h
sanitizer_allocator_report.cc
sanitizer_allocator_report.h
sanitizer_allocator_secondary.h
sanitizer_allocator_size_class_map.h
sanitizer_allocator_stats.h
sanitizer_allocator.cc
sanitizer_allocator.h
sanitizer_asm.h
sanitizer_atomic_clang_mips.h
sanitizer_atomic_clang_other.h
sanitizer_atomic_clang_x86.h
sanitizer_atomic_clang.h
sanitizer_atomic_msvc.h
sanitizer_atomic.h
sanitizer_bitvector.h
sanitizer_bvgraph.h
sanitizer_common_interceptors_format.inc
sanitizer_common_interceptors_ioctl.inc Remove svn:executable property from a couple of text files 2019-01-12 01:20:04 +01:00
sanitizer_common_interceptors.inc
sanitizer_common_interface_posix.inc
sanitizer_common_interface.inc
sanitizer_common_libcdep.cc
sanitizer_common_nolibc.cc
sanitizer_common_syscalls.inc
sanitizer_common.cc
sanitizer_common.h
sanitizer_coverage_fuchsia.cc
sanitizer_coverage_interface.inc
sanitizer_coverage_libcdep_new.cc
sanitizer_coverage_win_dll_thunk.cc
sanitizer_coverage_win_dynamic_runtime_thunk.cc
sanitizer_coverage_win_sections.cc
sanitizer_coverage_win_weak_interception.cc
sanitizer_dbghelp.h
sanitizer_deadlock_detector1.cc
sanitizer_deadlock_detector2.cc
sanitizer_deadlock_detector_interface.h
sanitizer_deadlock_detector.h
sanitizer_errno_codes.h
sanitizer_errno.cc
sanitizer_errno.h
sanitizer_file.cc
sanitizer_file.h
sanitizer_flag_parser.cc
sanitizer_flag_parser.h
sanitizer_flags.cc
sanitizer_flags.h
sanitizer_flags.inc
sanitizer_freebsd.h
sanitizer_fuchsia.cc
sanitizer_fuchsia.h
sanitizer_getauxval.h
sanitizer_interceptors_ioctl_netbsd.inc
sanitizer_interface_internal.h
sanitizer_internal_defs.h Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_lfstack.h
sanitizer_libc.cc
sanitizer_libc.h
sanitizer_libignore.cc
sanitizer_libignore.h
sanitizer_linux_libcdep.cc Fallback in libsanitizer for scudo sanitizer (PR sanitizer/87892). 2018-11-09 09:14:36 +00:00
sanitizer_linux_mips64.S
sanitizer_linux_s390.cc
sanitizer_linux_x86_64.S
sanitizer_linux.cc libsanitizer: Restore internal_readlink for x32 2019-02-20 08:20:50 -08:00
sanitizer_linux.h
sanitizer_list.h
sanitizer_mac_libcdep.cc
sanitizer_mac.cc Apply LOCAL_PATCHES and remove not used ones. 2018-10-31 11:16:17 +00:00
sanitizer_mac.h
sanitizer_malloc_mac.inc
sanitizer_mutex.h
sanitizer_netbsd.cc
sanitizer_openbsd.cc
sanitizer_persistent_allocator.cc
sanitizer_persistent_allocator.h
sanitizer_placement_new.h
sanitizer_platform_interceptors.h
sanitizer_platform_limits_linux.cc
sanitizer_platform_limits_netbsd.cc
sanitizer_platform_limits_netbsd.h
sanitizer_platform_limits_openbsd.cc
sanitizer_platform_limits_openbsd.h
sanitizer_platform_limits_posix.cc
sanitizer_platform_limits_posix.h
sanitizer_platform_limits_solaris.cc
sanitizer_platform_limits_solaris.h Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_platform.h
sanitizer_posix_libcdep.cc
sanitizer_posix.cc
sanitizer_posix.h
sanitizer_printf.cc
sanitizer_procmaps_bsd.cc
sanitizer_procmaps_common.cc
sanitizer_procmaps_linux.cc
sanitizer_procmaps_mac.cc
sanitizer_procmaps_solaris.cc Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_procmaps.h
sanitizer_quarantine.h
sanitizer_report_decorator.h
sanitizer_ring_buffer.h
sanitizer_rtems.cc
sanitizer_rtems.h
sanitizer_signal_interceptors.inc
sanitizer_solaris.cc Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_stackdepot.cc
sanitizer_stackdepot.h
sanitizer_stackdepotbase.h
sanitizer_stacktrace_libcdep.cc
sanitizer_stacktrace_printer.cc
sanitizer_stacktrace_printer.h
sanitizer_stacktrace_sparc.cc Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_stacktrace.cc Fix sanitizer frame unwind on 32-bit ABIs (again) 2018-11-05 20:41:29 +01:00
sanitizer_stacktrace.h Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_stoptheworld_linux_libcdep.cc
sanitizer_stoptheworld_mac.cc
sanitizer_stoptheworld.h
sanitizer_suppressions.cc
sanitizer_suppressions.h
sanitizer_symbolizer_fuchsia.h
sanitizer_symbolizer_internal.h
sanitizer_symbolizer_libbacktrace.cc
sanitizer_symbolizer_libbacktrace.h
sanitizer_symbolizer_libcdep.cc
sanitizer_symbolizer_mac.cc
sanitizer_symbolizer_mac.h
sanitizer_symbolizer_markup.cc
sanitizer_symbolizer_posix_libcdep.cc
sanitizer_symbolizer_report.cc
sanitizer_symbolizer_rtems.h
sanitizer_symbolizer_win.cc
sanitizer_symbolizer.cc
sanitizer_symbolizer.h
sanitizer_syscall_generic.inc
sanitizer_syscall_linux_aarch64.inc
sanitizer_syscall_linux_arm.inc
sanitizer_syscall_linux_x86_64.inc
sanitizer_syscalls_netbsd.inc
sanitizer_termination.cc
sanitizer_thread_registry.cc
sanitizer_thread_registry.h
sanitizer_tls_get_addr.cc
sanitizer_tls_get_addr.h
sanitizer_unwind_linux_libcdep.cc
sanitizer_unwind_win.cc
sanitizer_vector.h
sanitizer_win_defs.h
sanitizer_win_dll_thunk.cc
sanitizer_win_dll_thunk.h
sanitizer_win_dynamic_runtime_thunk.cc
sanitizer_win_weak_interception.cc
sanitizer_win_weak_interception.h
sanitizer_win.cc
sanitizer_win.h