This is the mail archive of the
mailing list for the binutils project.
Re: [1/9][RFC][DWARF] Reserve three DW_OP numbers in vendor extension space
- From: Jiong Wang <jiong dot wang at foss dot arm dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, gdb-patches at sourceware dot org, Binutils <binutils at sourceware dot org>, "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>
- Date: Tue, 15 Nov 2016 16:00:40 +0000
- Subject: Re: [1/9][RFC][DWARF] Reserve three DW_OP numbers in vendor extension space
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <email@example.com> <20161111193859.GJ3541@tucnak.redhat.com>
On 11/11/16 19:38, Jakub Jelinek wrote:
On Fri, Nov 11, 2016 at 06:21:48PM +0000, Jiong Wang wrote:
This patch introduces three AARCH64 private DWARF operations in vendor extension
Takes one unsigned LEB 128 Pointer Authentication Description. Bits [3:0] of
the description contain the Authentication Action Code. All unused bits are
initialized to 0. The operation then proceeds according to the value of the
action code as described in the Action Code Table.
Authenticates the contents in X30/LR register as per A key for instruction
pointer using current CFA as salt. The result is pushed onto the stack.
Takes one signed LEB128 offset and retrieves 8-byte contents from the address
calculated by CFA plus this offset, the contents then authenticated as per A
key for instruction pointer using current CFA as salt. The result is pushed
onto the stack.
I'd like to point out that especially the vendor range of DW_OP_* is
extremely scarce resource, we have only a couple of unused values, so taking
3 out of the remaining unused 12 for a single architecture is IMHO too much.
Can't you use just a single opcode and encode which of the 3 operations it is
in say the low 2 bits of a LEB 128 operand?
We'll likely need to do RSN some multiplexing even for the generic GNU
opcodes if we need just a few further ones (say 0xff as an extension,
followed by uleb128 containing the opcode - 0xff).
In the non-vendor area we still have 54 values left, so there is more space
for future expansion.
Seperate DWARF operations are introduced instead of combining all of them into
one are mostly because these operations are going to be used for most of the
functions once return address signing are enabled, and they are used for
describing frame unwinding that they will go into unwind table for C++ program
or C program compiled with -fexceptions, the impact on unwind table size is
significant. So I was trying to lower the unwind table size overhead as much as
IMHO, three numbers actually is not that much for one architecture in DWARF
operation vendor extension space as vendors can overlap with each other. The
only painful thing from my understand is there are platform vendors, for example
"GNU" and "LLVM" etc, for which architecture vendor can't overlap with.
In include/dwarf2.def, I saw DW_OP_GNU* has reserved 13, DW_OP_HP* has reserved
7 and DW_OP_PGI has reserved 1.
So for an alternative approach, can these AArch64 extensions overlap and reuse
those numbers reserved for DW_OP_HP* ? for example 0xe4, 0xe5, 0xe6. I am even
thinking GNU toolchain makes the 8 numbers reserved by existed DW_OP_HP* and
DW_OP_SGI* as architecture vendor area and allow multiplexing on them for
different architectures. This may offer more flexibilities for architecture
Under current code base, my search shows the overlap should be safe inside
GCC/GDB and we only needs minor disassemble tweak in Binutils.