gcc/libsanitizer/hwasan
Jakub Jelinek f39b7a4d37 hwasan: Add libhwasan_preinit.o
I've noticed an inconsistency with the other sanitizers.
For -fsanitize={address,thread,leak} we link into binaries
lib*san_preinit.o such that the -lasan, -ltsan or -llsan libraries
are initialized as early as possible through .preinit_array.
The hwasan library has the same thing, but we strangely compiled
it into the library (where it apparently didn't do anything,
.preinit_array doesn't seem to be created for shared libraries),
rather than installing it like in the other 3 cases.

The following patch handles it for hwasan similarly to asan, tsan and lsan.

I don't have any hw with hwasan support, so I've just checked it
builds and installs as expected and that
gcc -fsanitize=hwaddress -o a a.c -mlam=u57
on trivial main results in .preinit_array section in the binary.

2022-12-19  Jakub Jelinek  <jakub@redhat.com>

	* config/gnu-user.h (LIBHWASAN_EARLY_SPEC): Add libhwasan_preinit.o
	to link spec if not -shared.

	* hwasan/Makefile.am (nodist_toolexeclib_HEADERS): Set to
	libhwasan_preinit.o.
	(hwasan_files): Remove hwasan_preinit.cpp.
	(libhwasan_preinit.o): Copy from hwasan_preinit.o.
	* hwasan/Makefile.in: Regenerated.
2022-12-19 11:14:55 +01:00
..
hwasan.cpp libsanitizer: merge from upstream ae59131d3ef311fb4b1e50627c6457be00e60dc9 2022-11-15 16:44:55 +01:00
hwasan.h libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_allocation_functions.cpp
hwasan_allocator.cpp
hwasan_allocator.h libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_checks.h libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_dynamic_shadow.cpp
hwasan_dynamic_shadow.h
hwasan_exceptions.cpp libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_flags.h
hwasan_flags.inc libsanitizer: merge from upstream ae59131d3ef311fb4b1e50627c6457be00e60dc9 2022-11-15 16:44:55 +01:00
hwasan_fuchsia.cpp libsanitizer: merge from upstream ae59131d3ef311fb4b1e50627c6457be00e60dc9 2022-11-15 16:44:55 +01:00
hwasan_globals.cpp
hwasan_globals.h
hwasan_interceptors.cpp libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_interceptors_vfork.S
hwasan_interface_internal.h libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_linux.cpp libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_malloc_bisect.h
hwasan_mapping.h
hwasan_memintrinsics.cpp
hwasan_new_delete.cpp
hwasan_poisoning.cpp
hwasan_poisoning.h
hwasan_preinit.cpp
hwasan_report.cpp libsanitizer: merge from upstream ae59131d3ef311fb4b1e50627c6457be00e60dc9 2022-11-15 16:44:55 +01:00
hwasan_report.h
hwasan_setjmp_aarch64.S
hwasan_setjmp_riscv64.S libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_setjmp_x86_64.S
hwasan_tag_mismatch_aarch64.S
hwasan_tag_mismatch_riscv64.S libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
hwasan_thread.cpp
hwasan_thread.h
hwasan_thread_list.cpp
hwasan_thread_list.h
hwasan_type_test.cpp
libtool-version
Makefile.am hwasan: Add libhwasan_preinit.o 2022-12-19 11:14:55 +01:00
Makefile.in hwasan: Add libhwasan_preinit.o 2022-12-19 11:14:55 +01:00