llvm-6502/test/MC/PowerPC/ppc64-localentry.s
Ulrich Weigand 76fcace66e [MC] Pass MCSymbolData to needsRelocateWithSymbol
As discussed in a previous checking to support the .localentry
directive on PowerPC, we need to inspect the actual target symbol
in needsRelocateWithSymbol to make the appropriate decision based
on that symbol's st_other bits.

Currently, needsRelocateWithSymbol does not get the target symbol.
However, it is directly available to its sole caller.  This patch
therefore simply extends the needsRelocateWithSymbol by a new
parameter "const MCSymbolData &SD", passes in the target symbol,
and updates all derived implementations.

In particular, in the PowerPC implementation, this patch removes
the FIXME added by the previous checkin.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213487 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-20 23:15:06 +00:00

71 lines
1.5 KiB
ArmAsm

# RUN: llvm-mc -triple powerpc64-unknown-unknown -filetype=obj %s | \
# RUN: llvm-readobj -h -r -symbols | FileCheck %s
# RUN: llvm-mc -triple powerpc64le-unknown-unknown -filetype=obj %s | \
# RUN: llvm-readobj -h -r -symbols | FileCheck %s
.type callee1, @function
callee1:
nop
nop
.localentry callee1, .-callee1
nop
nop
.size callee1, .-callee1
.type callee2, @function
callee2:
nop
nop
.size callee2, .-callee2
.type caller, @function
caller:
bl callee1
nop
bl callee2
nop
.size caller, .-caller
.section .text.other
caller_other:
bl callee1
nop
bl callee2
nop
.size caller_other, .-caller_other
# Verify that use of .localentry implies ABI version 2
# CHECK: ElfHeader {
# CHECK: Flags [ (0x2)
# Verify that fixups to local function symbols are performed only
# if the target symbol does not use .localentry
# CHECK: Relocations [
# CHECK: Section ({{[0-9]*}}) .rela.text {
# CHECK-NEXT: R_PPC64_REL24 callee1
# CHECK-NEXT: }
# CHECK-NOT: R_PPC64_REL24 callee2
# CHECK: Section ({{[0-9]*}}) .rela.text.other {
# CHECK-NEXT: R_PPC64_REL24 callee1
# CHECK-NEXT: R_PPC64_REL24 .text
# CHECK-NEXT: }
# Verify that .localentry is encoded in the Other field.
# CHECK: Symbols [
# CHECK: Name: callee1
# CHECK-NEXT: Value:
# CHECK-NEXT: Size: 16
# CHECK-NEXT: Binding: Local
# CHECK-NEXT: Type: Function
# CHECK-NEXT: Other: 96
# CHECK-NEXT: Section: .text
# CHECK: Name: callee2
# CHECK-NEXT: Value:
# CHECK-NEXT: Size: 8
# CHECK-NEXT: Binding: Local
# CHECK-NEXT: Type: Function
# CHECK-NEXT: Other: 0
# CHECK-NEXT: Section: .text