aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2019-06-06 02:32:26 +0000
committerTom Stellard <tstellar@redhat.com>2019-06-06 02:32:26 +0000
commit0462c73f7610c1606f3f6fd80494ddd3e7b9cbab (patch)
tree4ba1b9914c550c6719a1c834b545531323bc42dd
parentc493057bdeede0e41902a2e8de6b5c8541a4237b (diff)
downloadllvm-0462c73f7610c1606f3f6fd80494ddd3e7b9cbab.zip
llvm-0462c73f7610c1606f3f6fd80494ddd3e7b9cbab.tar.gz
llvm-0462c73f7610c1606f3f6fd80494ddd3e7b9cbab.tar.bz2
Merging r360442:
------------------------------------------------------------------------ r360442 | maskray | 2019-05-10 10:09:25 -0700 (Fri, 10 May 2019) | 12 lines [MC][ELF] Copy top 3 bits of st_other to .symver aliases On PowerPC64 ELFv2 ABI, the top 3 bits of st_other encode the local entry offset. A versioned symbol alias created by .symver should copy the bits from the source symbol. This partly fixes PR41048. A full fix needs tracking of .set assignments and updating st_other fields when finish() is called, see D56586. Patch by Alfredo Dal'Ava JĂșnior Differential Revision: https://reviews.llvm.org/D59436 ------------------------------------------------------------------------ llvm-svn: 362669
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp1
-rw-r--r--llvm/test/MC/PowerPC/ppc64-localentry-symver.s17
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index ade8581..1b50577 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1271,6 +1271,7 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
// 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-symver.s b/llvm/test/MC/PowerPC/ppc64-localentry-symver.s
new file mode 100644
index 0000000..4c74906
--- /dev/null
+++ b/llvm/test/MC/PowerPC/ppc64-localentry-symver.s
@@ -0,0 +1,17 @@
+# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-freebsd13.0 %s -o %t
+# RUN: llvm-objdump -t %t | FileCheck %s
+
+# CHECK: 0000000000000000 gw F .text 00000000 0x60 __impl_foo
+# CHECK: 0000000000000000 g F .text 00000000 0x60 foo
+# CHECK: 0000000000000000 gw F .text 00000000 0x60 foo@FBSD_1.1
+
+.globl foo
+.type foo,@function
+foo:
+ nop
+ nop
+ .localentry foo, 8
+
+.symver __impl_foo, foo@FBSD_1.1
+.weak __impl_foo
+.set __impl_foo, foo