error "expression too complex"; complex relocation? (correction)

Peter Tanski peter_tanski at cox.net
Fri Dec 8 15:48:52 PST 2006


Hello,

This is now the third message I have posted on this topic.  Sorry for  
the extra emails.  Here is the x86 assembler that fails:

.section .rodata
	.align 4
_sys_srt:								; label1 here
	.long	_base_GHCziBase_unpackCStringzh_closure

; ...

.text
	.align 4,0x90
	.long	_sys_srt-(_sys_info)+0	; error here
	.long	0
	.long	65558
_sys_info:							; label2 here
	leal -12(%ebp),%eax
	cmpl 84(%ebx),%eax
	jb .LcyK
	addl $8,%edi
	cmpl 92(%ebx),%edi
	ja .LcyK
	movl $_stg_CAF_BLACKHOLE_info,-4(%edi)
	pushl %esi
	call _newCAF
	addl $4,%esp
	leal -4(%edi),%eax
	movl %eax,4(%esi)
	movl $_stg_IND_STATIC_info,(%esi)
	movl $_stg_upd_frame_info,-8(%ebp)
	leal -4(%edi),%eax
	movl %eax,-4(%ebp)
	movl $_base_GHCziBase_unpackCStringzh_closure,%esi
	movl $_cyB_str,-12(%ebp)
	addl $-12,%ebp
	jmp _stg_ap_n_fast
.LcyK:
	movl $8,112(%ebx)
	jmp *-8(%ebx)

The error occurs with the satement:
	_szy_srt-(_szy_info)
which is a complex relocation (_szy_srt and _szy_info are the start  
addresses of two different sections); WRT in Nasm.

Yasm outputs the "expression too complex" error for all output object  
formats--except 'bin' and 'dbg', of course.

I traced the "expression too complex" error to libyasm/value.c  
yasm_value_output_basic(), which according to the Note should not be  
used for cases where a reloc is needed.  Is this a bug in Yasm?

Cheers,
Peter Tanski




More information about the yasm-devel mailing list