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 Update build system: include new files and run autoheader, autoconf, automake 2018-10-31 11:15:57 +00:00
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 backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sancov_end.S backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sancov_flags.cc
sancov_flags.h
sancov_flags.inc
sanitizer_addrhashmap.h
sanitizer_allocator_bytemap.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_checks.cc
sanitizer_allocator_checks.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_combined.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_interface.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_internal.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_local_cache.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_primary32.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_primary64.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_report.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_report.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_secondary.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_size_class_map.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator_stats.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_allocator.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_asm.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_atomic_clang_mips.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_atomic_clang_other.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_atomic_clang_x86.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_atomic_clang.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_atomic_msvc.h
sanitizer_atomic.h
sanitizer_bitvector.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_bvgraph.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
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 backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_common_interface_posix.inc
sanitizer_common_interface.inc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_common_libcdep.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_common_nolibc.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_common_syscalls.inc
sanitizer_common.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_common.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_coverage_fuchsia.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_coverage_interface.inc
sanitizer_coverage_libcdep_new.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_coverage_win_dll_thunk.cc
sanitizer_coverage_win_dynamic_runtime_thunk.cc
sanitizer_coverage_win_sections.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_coverage_win_weak_interception.cc
sanitizer_dbghelp.h
sanitizer_deadlock_detector1.cc
sanitizer_deadlock_detector2.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_deadlock_detector_interface.h
sanitizer_deadlock_detector.h
sanitizer_errno_codes.h
sanitizer_errno.cc
sanitizer_errno.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_file.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_file.h
sanitizer_flag_parser.cc
sanitizer_flag_parser.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_flags.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_flags.h
sanitizer_flags.inc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_freebsd.h
sanitizer_fuchsia.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_fuchsia.h
sanitizer_getauxval.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_interceptors_ioctl_netbsd.inc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_interface_internal.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
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 backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_libc.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_libignore.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_libignore.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
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 backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_linux_x86_64.S backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_linux.cc libsanitizer: Restore internal_readlink for x32 2019-02-20 08:20:50 -08:00
sanitizer_linux.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_list.h
sanitizer_mac_libcdep.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_mac.cc Apply LOCAL_PATCHES and remove not used ones. 2018-10-31 11:16:17 +00:00
sanitizer_mac.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_malloc_mac.inc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_mutex.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_netbsd.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_openbsd.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_persistent_allocator.cc
sanitizer_persistent_allocator.h
sanitizer_placement_new.h
sanitizer_platform_interceptors.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_linux.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_netbsd.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_netbsd.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_openbsd.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_openbsd.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_posix.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_posix.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_solaris.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_platform_limits_solaris.h Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_platform.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_posix_libcdep.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_posix.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_posix.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_printf.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_procmaps_bsd.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_procmaps_common.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_procmaps_linux.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_procmaps_mac.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_procmaps_solaris.cc Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_procmaps.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_quarantine.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_report_decorator.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_ring_buffer.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_rtems.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_rtems.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_signal_interceptors.inc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_solaris.cc Cherry-pick Solaris sanitizer fixes (PR sanitizer/80953) 2018-11-06 10:42:05 +00:00
sanitizer_stackdepot.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_stackdepot.h
sanitizer_stackdepotbase.h
sanitizer_stacktrace_libcdep.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_stacktrace_printer.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
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 backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_stoptheworld_mac.cc
sanitizer_stoptheworld.h
sanitizer_suppressions.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_suppressions.h
sanitizer_symbolizer_fuchsia.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_symbolizer_internal.h
sanitizer_symbolizer_libbacktrace.cc
sanitizer_symbolizer_libbacktrace.h
sanitizer_symbolizer_libcdep.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_symbolizer_mac.cc
sanitizer_symbolizer_mac.h
sanitizer_symbolizer_markup.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_symbolizer_posix_libcdep.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_symbolizer_report.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_symbolizer_rtems.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_symbolizer_win.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_symbolizer.cc
sanitizer_symbolizer.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_syscall_generic.inc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_syscall_linux_aarch64.inc
sanitizer_syscall_linux_arm.inc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_syscall_linux_x86_64.inc
sanitizer_syscalls_netbsd.inc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_termination.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_thread_registry.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_thread_registry.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_tls_get_addr.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_tls_get_addr.h
sanitizer_unwind_linux_libcdep.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_unwind_win.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_vector.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_win_defs.h backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_win_dll_thunk.cc
sanitizer_win_dll_thunk.h
sanitizer_win_dynamic_runtime_thunk.cc
sanitizer_win_weak_interception.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_win_weak_interception.h
sanitizer_win.cc backport: All source files: Merge from upstream 345033. 2018-10-31 11:14:23 +00:00
sanitizer_win.h