[cft] rewrite i386 dllimport/dllexport

Danny Smith dannysmith@clear.net.nz
Sun Mar 25 11:21:00 GMT 2007


 Richard Henderson
 Saturday, 24 March 2007 12:51 p.m.

> Anyway, testing this properly is beyond what I'm set up to do
> at present, so assistance is greatly appreciated.


Hello Richard

Thanks for doing this.
Unfortunately the changes appear to force all local functions to be
called as indirect refs.
eg:

With your patch, this:

static int bar (void) __attribute__((noinline)) ;
static int bar () {return 0;}
int foo () { return bar( );} 
 
foo gets compiled as 

	pushl	%ebp
	movl	%esp, %ebp
	movl	$_bar, %eax
	call	*%eax
	popl	%ebp
	ret

rather than (without your patch) as:

_foo:
	pushl	%ebp
	movl	%esp, %ebp
	call	_bar
	popl	%ebp
	ret

This causes failure of libgcc build in unwind-dw2.c where, with
optimization,  we get invalid assembly code like this:
...
	call	*$_read_uleb128

Danny

> 
> 
> r~





More information about the Gcc-patches mailing list