brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.1 KiB · 59aed15 Raw
108 lines · plain
1# REQUIRES: ppc2# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/ppc64-toc-relax-shared.s -o %t.o3# RUN: ld.lld -shared -soname=t.so %t.o -o %t.so4# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t1.o5# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %p/Inputs/ppc64-toc-relax.s -o %t2.o6# RUN: llvm-readobj -r %t1.o | FileCheck --check-prefixes=RELOCS-LE,RELOCS %s7# RUN: ld.lld %t1.o %t2.o %t.so -o %t8# RUN: llvm-nm %t | FileCheck --check-prefix=NM %s9# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefixes=COMMON,EXE %s10 11# RUN: ld.lld -shared %t1.o %t2.o %t.so -o %t2.so12# RUN: llvm-objdump -d --no-show-raw-insn %t2.so | FileCheck --check-prefixes=COMMON,SHARED %s13 14# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/ppc64-toc-relax-shared.s -o %t.o15# RUN: ld.lld -shared -soname=t.so %t.o -o %t.so16# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t1.o17# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %p/Inputs/ppc64-toc-relax.s -o %t2.o18# RUN: llvm-readobj -r %t1.o | FileCheck --check-prefixes=RELOCS-BE,RELOCS %s19# RUN: ld.lld %t1.o %t2.o %t.so -o %t20# RUN: llvm-nm %t | FileCheck --check-prefix=NM %s21# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck --check-prefixes=COMMON,EXE %s22 23# RUN: ld.lld -shared %t1.o %t2.o %t.so -o %t2.so24# RUN: llvm-objdump -d --no-show-raw-insn %t2.so | FileCheck --check-prefixes=COMMON,SHARED %s25 26# RELOCS-LE:      .rela.text {27# RELOCS-LE-NEXT:   0x0 R_PPC64_TOC16_HA .toc 0x028# RELOCS-LE-NEXT:   0x4 R_PPC64_TOC16_LO_DS .toc 0x029# RELOCS-LE-NEXT:   0xC R_PPC64_TOC16_HA .toc 0x830# RELOCS-LE-NEXT:   0x10 R_PPC64_TOC16_LO_DS .toc 0x831# RELOCS-LE-NEXT:   0x18 R_PPC64_TOC16_HA .toc 0x1032# RELOCS-LE-NEXT:   0x1C R_PPC64_TOC16_LO_DS .toc 0x1033# RELOCS-LE-NEXT:   0x24 R_PPC64_TOC16_HA .toc 0x1834# RELOCS-LE-NEXT:   0x28 R_PPC64_TOC16_LO_DS .toc 0x1835# RELOCS-LE-NEXT: }36 37# RELOCS-BE:      .rela.text {38# RELOCS-BE-NEXT:   0x2 R_PPC64_TOC16_HA .toc 0x039# RELOCS-BE-NEXT:   0x6 R_PPC64_TOC16_LO_DS .toc 0x040# RELOCS-BE-NEXT:   0xE R_PPC64_TOC16_HA .toc 0x841# RELOCS-BE-NEXT:   0x12 R_PPC64_TOC16_LO_DS .toc 0x842# RELOCS-BE-NEXT:   0x1A R_PPC64_TOC16_HA .toc 0x1043# RELOCS-BE-NEXT:   0x1E R_PPC64_TOC16_LO_DS .toc 0x1044# RELOCS-BE-NEXT:   0x26 R_PPC64_TOC16_HA .toc 0x1845# RELOCS-BE-NEXT:   0x2A R_PPC64_TOC16_LO_DS .toc 0x1846# RELOCS-BE-NEXT: }47 48# RELOCS:         .rela.toc {49# RELOCS-NEXT:      0x0 R_PPC64_ADDR64 hidden 0x050# RELOCS-NEXT:      0x8 R_PPC64_ADDR64 hidden2 0x051# RELOCS-NEXT:      0x10 R_PPC64_ADDR64 shared 0x052# RELOCS-NEXT:      0x18 R_PPC64_ADDR64 default 0x053# RELOCS-NEXT:    }54 55# NM-DAG: 00000000100303b0 D default56# NM-DAG: 00000000100303b0 d hidden57# NM-DAG: 00000000100403b0 d hidden258 59# 'hidden' is non-preemptable. It is relaxed.60# address(hidden) - (.got+0x8000) = 0x100303b0 - (0x10020390+0x8000) = (1<<16) - 3273661# COMMON: addis 3, 2, 162# COMMON: addi 3, 3, -3273663# COMMON: lwa 3, 0(3)64  addis 3, 2, .Lhidden@toc@ha65  ld    3, .Lhidden@toc@l(3)66  lwa   3, 0(3)67 68# address(hidden2) - (.got+0x8000) = 0x100403b0 - (0x10020390+0x8000) = (2<<16) - 3273669# COMMON: addis 3, 2, 270# COMMON: addi 3, 3, -3273671# COMMON: lwa 3, 0(3)72  addis 3, 2, .Lhidden2@toc@ha73  ld    3, .Lhidden2@toc@l(3)74  lwa   3, 0(3)75 76# 'shared' is not defined in an object file. Its definition is determined at77# runtime by the dynamic linker, so the extra indirection cannot be relaxed.78# The first addis can still be relaxed to nop, though.79# COMMON: nop80# COMMON: ld 4, -32752(2)81# COMMON: lwa 4, 0(4)82  addis 4, 2, .Lshared@toc@ha83  ld    4, .Lshared@toc@l(4)84  lwa   4, 0(4)85 86# 'default' has default visibility. It is non-preemptable when producing an executable.87# address(default) - (.got+0x8000) = 0x100303b0 - (0x10020390+0x8000) = (1<<16) - 3273688# EXE: addis 5, 2, 189# EXE: addi 5, 5, -3273690# EXE: lwa 5, 0(5)91 92# SHARED: nop93# SHARED: ld 5, -32744(2)94# SHARED: lwa 5, 0(5)95  addis 5, 2, .Ldefault@toc@ha96  ld    5, .Ldefault@toc@l(5)97  lwa   5, 0(5)98 99.section .toc,"aw",@progbits100.Lhidden:101  .tc hidden[TC], hidden102.Lhidden2:103  .tc hidden2[TC], hidden2104.Lshared:105  .tc shared[TC], shared106.Ldefault:107  .tc default[TC], default108