This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [Fwd: Add DW_OP_GNU_encoded_addr]


Before this gets into wide-spread use, would it be possible to adjust the
operand order of .cfi_val_encoded_addr so that the encoding value would
be last and could hence be made optional (with a default resulting in the
smaller DW_OP_addr encoding)?

While at this, fixing the incorrect reference to .cfi_lsda in one of the new
error messages would also be nice.

Thanks, Jan

>>> Richard Henderson <rth@redhat.com> 25.09.08 01:24 >>>
Here's the gas/binutils part of the feature I just posted about
on the gcc list.


r~


-------- Original Message --------
Subject: Add DW_OP_GNU_encoded_addr
Date: Wed, 24 Sep 2008 16:14:18 -0700
From: Richard Henderson <rth@redhat.com>
To: gcc-patches@gcc.gnu.org 

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.


r~



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