Skip to content

Commit 0462c73

Browse files
committed
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
1 parent c493057 commit 0462c73

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

llvm/lib/MC/ELFObjectWriter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,7 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssembler &Asm,
12711271
// This is the first place we are able to copy this information.
12721272
Alias->setExternal(Symbol.isExternal());
12731273
Alias->setBinding(Symbol.getBinding());
1274+
Alias->setOther(Symbol.getOther());
12741275

12751276
if (!Symbol.isUndefined() && !Rest.startswith("@@@"))
12761277
continue;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-freebsd13.0 %s -o %t
2+
# RUN: llvm-objdump -t %t | FileCheck %s
3+
4+
# CHECK: 0000000000000000 gw F .text 00000000 0x60 __impl_foo
5+
# CHECK: 0000000000000000 g F .text 00000000 0x60 foo
6+
# CHECK: 0000000000000000 gw F .text 00000000 0x60 foo@FBSD_1.1
7+
8+
.globl foo
9+
.type foo,@function
10+
foo:
11+
nop
12+
nop
13+
.localentry foo, 8
14+
15+
.symver __impl_foo, foo@FBSD_1.1
16+
.weak __impl_foo
17+
.set __impl_foo, foo

0 commit comments

Comments
 (0)