|
From: Mark W. <ma...@so...> - 2020-01-24 10:43:59
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2dab3249867615055a680cad7fccb22411587579 commit 2dab3249867615055a680cad7fccb22411587579 Author: Mark Wielaard <ma...@kl...> Date: Fri Jan 24 11:26:25 2020 +0100 Fix tests/x86/incdec_alt.c asm for GCC10. Thanks to Jakub Jelinek. The test is broken. It blindly assumes the toplevel inline asm is placed into some sensible section, but that is a wrong assumption. The right thing is to start the inline asm with .text directive and end with .previous. The reason gcc 10 breaks it is the -fno-common default, the int r1, ... vars are emitted into .bss section and that is the section that is current when the inline asm is emitted previously they were in .common at the end of the assembly file. Diff: --- none/tests/x86/incdec_alt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/none/tests/x86/incdec_alt.c b/none/tests/x86/incdec_alt.c index 2db3242..b8ff5c0 100644 --- a/none/tests/x86/incdec_alt.c +++ b/none/tests/x86/incdec_alt.c @@ -8,6 +8,7 @@ int r1,r2,r3,r4,r5,r6,r7,r8,a1,a2; extern void foo ( void ); asm("\n" +".text\n" VG_SYM(foo) ":\n" "\tpushl $0\n" "\tpopfl\n" @@ -49,6 +50,7 @@ VG_SYM(foo) ":\n" "\tpopl " VG_SYM(r8) "\n" "\tret\n" +".previous\n" ); int main ( void ) |