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: Add DW_OP_GNU_encoded_addr



On Sep 24, 2008, at 4:14 PM, Richard Henderson wrote:


This is a new dwarf unwind expression opcode that allows an absolute
address to be put into the .eh_frame section without having to resort
to DW_OP_addr, which would result in runtime relocations in shared
libraries.

This opcode will be generated by a new gas .cfi_val_encoded_addr
directive.  This directive is intended to be used with inline assembly
which actually contains out-of-line code (i.e. in another section).
E.g.

 asm(	"test something
	jnz 1f
	.section text2,\"ax\"
1:	.cfi_startproc simple
	.cfi_def_cfa %%esp, 0
	.cfi_val_encoded_addr %%eip, 0x1b, 11f
	<do-some-stuff>
	jmp 11f
	.cfi_endproc
	.previous
11:");

This is an idiom that shows up several places in glibc and in the
kernel.  In glibc, Jakub currently goes to heroic efforts to
generate the unwind information by hand, but this code is what you
might call write-only i.e. intensely difficult to modify.

Does this idiom work if the inline asm block is duplicated by the compiler (e.g. due to inlining, loop unrolling, etc)?


-Chris


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