1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/test/MC/PowerPC/ppc64-localentry-symbols.s
Fangrui Song 3b526166e2 [PPC64] Update LocalEntry from assigned symbols
On PowerPC64 ELFv2 ABI, functions may have 2 entry points: global and local.
The local entry point location of a function is stored in the st_other field of the symbol, as an offset relative to the global entry point.

In order to make symbol assignments (e.g. .equ/.set) work properly with this, PPCTargetELFStreamer already copies the local entry bits from the source symbol to the destination one, on emitAssignment(). The problem is that this copy is performed only at the assignment location, where the source symbol may not yet have processed the .localentry directive, that sets the local entry. This may cause the destination symbol to end up with wrong local entry information. Other symbol info is not affected by this because, in this case, the destination symbol value is actually a symbol reference.

This change keeps track of these assignments, and update all needed st_other fields when finish() is called.

Patch by Leandro Lupori!

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D56586

llvm-svn: 361237
2019-05-21 10:41:25 +00:00

35 lines
777 B
ArmAsm

# 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
# CHECK: 0000000000000008 g F .text 00000000 0x60 func
# CHECK: 0000000000000008 gw F .text 00000000 0x60 weak_func
.text
.abiversion 2
.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
.globl func
# Mimick FreeBSD weak function/reference
.weak weak_func
.equ weak_func, func
.p2align 2
.type func,@function
func:
nop
nop
.localentry func, 8