diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -1279,6 +1279,7 @@ // This is the first place we are able to copy this information. Alias->setExternal(Symbol.isExternal()); Alias->setBinding(Symbol.getBinding()); + Alias->setOther(Symbol.getOther()); if (!Symbol.isUndefined() && !Rest.startswith("@@@")) continue; diff --git a/llvm/test/MC/PowerPC/ppc64-localentry-versioned-flags.s b/llvm/test/MC/PowerPC/ppc64-localentry-versioned-flags.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/PowerPC/ppc64-localentry-versioned-flags.s @@ -0,0 +1,58 @@ + +# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-freebsd13.0 %s -o %t.o +# RUN: llvm-objdump -t %t.o | FileCheck %s + + +.text +.abiversion 2 + +.symver __impl_openattt, openattt@FBSD_1.1 +.weak __impl_openattt +.set __impl_openattt, openattt + +.globl openattt +.p2align 2 +.type openattt,@function + + +openattt: # @openattt +.Lfunc_begin0: +.Lfunc_gep0: + addis 2, 12, .TOC.-.Lfunc_gep0@ha + addi 2, 2, .TOC.-.Lfunc_gep0@l +.Lfunc_lep0: + .localentry openattt, .Lfunc_lep0-.Lfunc_gep0 +# %bb.0: + addis 3, 2, .LC0@toc@ha + ld 3, .LC0@toc@l(3) + li 4, 123 + stw 4, 0(3) + lwa 3, 0(3) + blr + .long 0 + .quad 0 +.Lfunc_end0: + .size openattt, .Lfunc_end0-.Lfunc_begin0 + .section .toc,"aw",@progbits +.LC0: + .tc a[TC],a + .type a,@object # @a + .section .bss,"aw",@nobits + .globl a + .p2align 2 +a: + .long 0 # 0x0 + .size a, 4 + + .addrsig + .addrsig_sym a + + +# CHECK: SYMBOL TABLE: +# CHECK-NEXT: 0000000000000000 l d .toc 00000000 .toc +# CHECK-NEXT: 0000000000000000 *UND* 00000000 .TOC. +# CHECK-NEXT: 0000000000000000 gw F .text 0000002c 0x60 __impl_openattt +# CHECK-NEXT: 0000000000000000 g O .bss 00000004 a +# CHECK-NEXT: 0000000000000000 g F .text 0000002c 0x60 openattt +# CHECK-NEXT: 0000000000000000 gw F .text 0000002c 0x60 openattt@FBSD_1.1 +