Move __libc_int0x80 to an assembly file
Bug: http://b/157081822
If __libc_int0x80 is in a C/C++ file, Clang's coverage instrumentation
adds instructions to count the number of times it gets executed [1].
With coverage instrumentation, __libc_sysinfo, used on 32-bit x86, is
initialized to the wrong value, causing dl.preinit_system_calls to fail.
Moving the function to an assembly file leaves __libc_sysinfo properly
initialized.
[1] We could change clang so it doesn't instrument functions marked
__attribute__((naked)) as a followup.
Test: `m CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS=bionic` and run
bionic-unit-tests
Change-Id: I73558253512392d345de8d5b66d38bb14b308fdf
diff --git a/libc/arch-x86/bionic/__libc_int0x80.S b/libc/arch-x86/bionic/__libc_int0x80.S
new file mode 100644
index 0000000..66f0a1a
--- /dev/null
+++ b/libc/arch-x86/bionic/__libc_int0x80.S
@@ -0,0 +1,7 @@
+#include <private/bionic_asm.h>
+
+// void __libc_int0x80();
+ENTRY_PRIVATE(__libc_int0x80)
+ int $0x80
+ ret
+END(__libc_int0x80)