Fedora Account System
Red Hat Associate
Red Hat Customer
This program: __attribute__((__target__("sse4.2"))) int sum (int a, int b, int c) { return a + b + c; } When compiled using g++ --specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -S -o- -O2 mangled.cc produces this assembler output: … .popsection .text .p2align 4,,15 .globl _Z3sumiii .type _Z3sumiii, @function _Z3sumiii: .LFB0: .cfi_startproc addl %esi, %edi leal (%rdi,%rdx), %eax ret .cfi_endproc .LFE0: .size _Z3sumiii, .-_Z3sumiii .pushsection .gnu.build.attributes .dc.l 12 # size of name .dc.l 8 # descsz = sizeof (address) .dc.l 0x101 # type = FUNC .dc.b 0x47, 0x41, 0x2a, 0x6, 0x12, 0, 0, 0x40, 0x44, 0x2, 0x5e, 0 # name (numeric: ABI) .quad int sum(int, int, int) # description (symbol name) .popsection The problem is the unmangled symbol in the .quad output, which is not valid assembler syntax.
The problem is the use of current_function_name. It uses a langhook to produce the demangled version of the name, which is not appropriate. We need the assembler symbol here.
Created attachment 1361087 [details] funname.patch The patch I'm going to use.
Created attachment 1361098 [details] funname.patch This version also updates the aarch64 code.