This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Further improved native as support on Solaris/x86


On Fri, 21 Jul 2006, Jakub Jelinek wrote:
> There is nothing wrong on this, .long   DW.ref.__gxx_personality_v0-.
> just becomes a PC relative relocation, which x86-64 has.
> As long as the second symbol in the subtraction is dot or dot + constant
> or some non-exported symbol in the same fragment, there is nothing
> to warn about and it is clear what should be emitted.

For the case of the dwarf2 exception table, here's the full assembler
language output and assembler messages from the earlier C++ example.

void free(void *);

void operator delete (void *ptr) throw ()
{
  if (ptr)
    free (ptr);
}


produces with -m64 -fPIC:

	.file	"section.C"
.globl _Unwind_Resume
	.text
	.align 2
	.align 16
.globl _ZdlPv
	.type	_ZdlPv, @function
_ZdlPv:
.LFB2:
	pushq	%rbp
.LCFI0:
	testq	%rdi, %rdi
	movq	%rsp, %rbp
.LCFI1:
	je	.L5
.LEHB0:
	call	_Z4freePv@PLT
.LEHE0:
.L5:
	leave
	ret
.L7:
	addq	$1, %rdx
	movq	%rax, %rdi
	je	.L4
.LEHB1:
	call	_Unwind_Resume@PLT
.L4:
	call	__cxa_call_unexpected@PLT
.LEHE1:
.LFE2:
	.size	_ZdlPv, .-_ZdlPv
.globl __gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
	.align 4
.LLSDA2:
	.byte	0xff
	.byte	0x9b
	.byte	0x21
	.byte	0x3
	.byte	0x1a
	.long	.LEHB0-.LFB2
	.long	.LEHE0-.LEHB0
	.long	.L7-.LFB2
	.byte	0x1
	.long	.LEHB1-.LFB2
	.long	.LEHE1-.LEHB1
	.long	0x0
	.byte	0x0
	.byte	0x7f
	.byte	0x0
	.align 4
	.byte	0x0
	.text
	.section	.eh_frame,"a",@unwind
.Lframe1:
	.long	.LECIE1-.LSCIE1
.LSCIE1:
	.long	0x0
	.byte	0x1
	.string	"zPLR"
	.byte	0x1
	.byte	0x78
	.byte	0x10
	.byte	0x7
	.byte	0x9b
	.long	.LDFCM0-.
	.byte	0x1b
	.byte	0x1b
	.byte	0xc
	.byte	0x7
	.byte	0x8
	.byte	0x90
	.byte	0x1
	.align 8
.LECIE1:
.LSFDE1:
	.long	.LEFDE1-.LASFDE1
.LASFDE1:
	.long	.LASFDE1-.Lframe1
	.long	.LFB2-.
	.long	.LFE2-.LFB2
	.byte	0x4
	.long	.LLSDA2-.
	.byte	0x4
	.long	.LCFI0-.LFB2
	.byte	0xe
	.byte	0x10
	.byte	0x86
	.byte	0x2
	.byte	0x4
	.long	.LCFI1-.LCFI0
	.byte	0xd
	.byte	0x6
	.align 8
.LEFDE1:
	.data
	.align 8
	.type	.LDFCM0, @object
	.size	.LDFCM0, 8
.LDFCM0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (GNU) 4.2.0 20060721 (experimental)"


which produces the error messages:

Assembler: section.C
        "section.s", line 81 : Warning: Illegal subtraction - symbols from
different sections: ".LFB2", ".DOT-2"
        "section.s", line 84 : Warning: Illegal subtraction - symbols from
different sections: ".LLSDA2", ".DOT-3"
        "section.s", line 67 : Illegal subtraction - symbols from
different sections: ".LDFCM0", ".DOT-1"


This may be valid, though I'm not sure where that's defined.
Certainly it isn't portable, and the native C++ compiler on
Solaris is clearly able to compile code without using this
idiom.

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]