brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · c937048 Raw
92 lines · plain
1# REQUIRES: ppc2# RUN: echo 'SECTIONS { \3# RUN:       .text_low 0x2000: { *(.text_low) } \4# RUN:       .text_high 0x2002000 : { *(.text_high) } \5# RUN:       }' > %t.script6 7# RUN: llvm-mc -filetype=obj -triple=ppc64le %s -o %t.o8# RUN: ld.lld -T %t.script %t.o -o %t9# RUN: llvm-readelf -S -r %t | FileCheck --check-prefix=SEC %s10# RUN: llvm-readelf -x .branch_lt %t | FileCheck --check-prefix=BRANCH-LE %s11# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s12# RUN: llvm-nm --no-sort %t | FileCheck --check-prefix=NM %s13 14# RUN: llvm-mc -filetype=obj -triple=ppc64 %s -o %t.o15# RUN: ld.lld -T %t.script %t.o -o %t16# RUN: llvm-readelf -S -r %t | FileCheck --check-prefix=SEC %s17# RUN: llvm-readelf -x .branch_lt %t | FileCheck --check-prefix=BRANCH-BE %s18# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s19# RUN: llvm-nm --no-sort %t | FileCheck --check-prefix=NM %s20 21# SEC: Name       Type     Address          Off     Size   ES Flg Lk Inf Al22# SEC: .got       PROGBITS 0000000002002040 2002040 000008 00  WA  0   0  823# SEC: .branch_lt PROGBITS 0000000002002048 2002048 000018 00  WA  0   0  824 25# SEC: There are no relocations in this file.26 27## high@localentry (high+8), .text_high+16 and .text_low+828# BRANCH-LE:      0x02002048 08200002 00000000 10200002 0000000029# BRANCH-LE-NEXT: 0x02002058 08200000 0000000030# BRANCH-BE:      0x02002048 00000000 02002008 00000000 0200201031# BRANCH-BE-NEXT: 0x02002058 00000000 0000200832 33# CHECK:      <_start>:34# CHECK-NEXT:     2000:       bl 0x202035# CHECK-NEXT:                 bl 0x202036# CHECK-NEXT:                 bl 0x202037# CHECK-NEXT:                 bl 0x200200838 39## &.branch_lt[0] - .TOC. = .branch_lt - (.got+0x8000) = -3276040# CHECK:      <__long_branch_high>:41# CHECK-NEXT:     2020:       addis 12, 2, 042# CHECK-NEXT:                 ld 12, -32760(12)43# CHECK-NEXT:                 mtctr 1244# CHECK-NEXT:                 bctr45 46## &.branch_lt[1] - .TOC. = .branch_lt - (.got+0x8000) = -3275247# CHECK:      <__long_branch_>:48# CHECK-NEXT:     2040:       addis 12, 2, 049# CHECK-NEXT:                 ld 12, -32752(12)50# CHECK-NEXT:                 mtctr 1251# CHECK-NEXT:                 bctr52 53.section .text_low, "ax", %progbits54.globl _start55_start:56bl high          # Need a thunk57bl high          # Need a thunk58bl high          # Need a thunk59bl high60bl .text_high+16 # Need a thunk61blr62 63# CHECK:      Disassembly of section .text_high:64# CHECK-EMPTY:65# CHECK-NEXT: <high>:66# CHECK-NEXT:  2002000:       addis 2, 12, 167# CHECK-NEXT:                 addi 2, 2, -3270468# CHECK-NEXT:                 bl 0x200869# CHECK-NEXT:                 bl 0x200202070# CHECK:      <__long_branch_>:71# CHECK-NEXT:  2002020:       addis 12, 2, 072# CHECK-NEXT:                 ld 12, -32744(12)73# CHECK-NEXT:                 mtctr 1274# CHECK-NEXT:                 bctr75 76.section .text_high, "ax", %progbits77.globl high78high:79addis 2, 12, .TOC.-high@ha80addi 2, 2, .TOC.-high@l81.localentry high, 882bl .text_low+883bl .text_low+8 # Need a thunk84blr85 86# NM:      d .TOC.87# NM-NEXT: t __long_branch_high88# NM-NEXT: t __long_branch_{{$}}89# NM-NEXT: t __long_branch_{{$}}90# NM-NEXT: T _start91# NM-NEXT: T high92