From cc6cb7f0e294f0c98c4970c7ec993709fc2daa1a Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 4 Dec 2017 03:51:14 +0100 Subject: Fix another corner case with C/asm symtable See testcase (from grischka). If the asm has no .globl, but there's a (non-static) C definition the symbol should be exported, even if the first reference comes from asm. --- tests/asm-c-connect-2.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/asm-c-connect-2.c') diff --git a/tests/asm-c-connect-2.c b/tests/asm-c-connect-2.c index 7ab9dc3..5dad26c 100644 --- a/tests/asm-c-connect-2.c +++ b/tests/asm-c-connect-2.c @@ -6,5 +6,14 @@ int x3(void) return 3; } +/* That callx4 is defined globally (as if ".globl callx4") + is a TCC extension. GCC doesn't behave like this. */ void callx4(void); __asm__("callx4: call x4; ret"); + +extern void x5(void); +void callx5_again(void); +void callx5_again(void) +{ + x5(); +} -- cgit v1.3.1