diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp --- a/llvm/lib/MC/MCELFStreamer.cpp +++ b/llvm/lib/MC/MCELFStreamer.cpp @@ -438,11 +438,14 @@ case MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HI: case MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HA: case MCSymbolRefExpr::VK_PPC_TLS: + case MCSymbolRefExpr::VK_PPC_GOT_TPREL_PCREL: + case MCSymbolRefExpr::VK_PPC_TLS_PCREL: case MCSymbolRefExpr::VK_PPC_GOT_TLSGD: case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_LO: case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HI: case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HA: case MCSymbolRefExpr::VK_PPC_TLSGD: + case MCSymbolRefExpr::VK_PPC_GOT_TLSGD_PCREL: case MCSymbolRefExpr::VK_PPC_GOT_TLSLD: case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_LO: case MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HI: diff --git a/llvm/test/CodeGen/PowerPC/pcrel-tls-general-dynamic.ll b/llvm/test/CodeGen/PowerPC/pcrel-tls-general-dynamic.ll --- a/llvm/test/CodeGen/PowerPC/pcrel-tls-general-dynamic.ll +++ b/llvm/test/CodeGen/PowerPC/pcrel-tls-general-dynamic.ll @@ -3,8 +3,9 @@ ; RUN: -enable-ppc-pcrel-tls < %s | FileCheck %s --check-prefix=CHECK-S ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \ ; RUN: --relocation-model=pic -mcpu=pwr10 -ppc-asm-full-reg-names \ -; RUN: -enable-ppc-pcrel-tls --filetype=obj < %s | \ -; RUN: llvm-objdump --mcpu=pwr10 -dr - | FileCheck %s --check-prefix=CHECK-O +; RUN: -enable-ppc-pcrel-tls --filetype=obj -o %t.o < %s +; RUN: llvm-objdump --mcpu=pwr10 -dr %t.o |FileCheck %s --check-prefix=CHECK-O +; RUN: llvm-readelf -s %t.o | FileCheck %s --check-prefix=CHECK-SYM ; These test cases are to ensure that when using pc relative memory operations ; ABI correct code and relocations are produced for General Dynamic TLS Model. @@ -45,6 +46,9 @@ ; CHECK-O-NEXT: 0000000000000054: R_PPC64_TLSGD x ; CHECK-O-NEXT: 0000000000000054: R_PPC64_REL24_NOTOC __tls_get_addr ; CHECK-O-NEXT: 58: 00 00 63 80 lwz 3, 0(3) + + ; CHECK-SYM-LABEL: Symbol table '.symtab' contains 7 entries + ; CHECK-SYM: 6: 0000000000000000 0 TLS GLOBAL DEFAULT UND x entry: %0 = load i32, i32* @x, align 4 ret i32 %0 diff --git a/llvm/test/CodeGen/PowerPC/pcrel-tls-initial-exec.ll b/llvm/test/CodeGen/PowerPC/pcrel-tls-initial-exec.ll --- a/llvm/test/CodeGen/PowerPC/pcrel-tls-initial-exec.ll +++ b/llvm/test/CodeGen/PowerPC/pcrel-tls-initial-exec.ll @@ -3,8 +3,9 @@ ; RUN: FileCheck %s --check-prefix=CHECK-S ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \ ; RUN: -mcpu=pwr10 -ppc-asm-full-reg-names --filetype=obj \ -; RUN: -enable-ppc-pcrel-tls < %s | llvm-objdump --mcpu=pwr10 -dr - | \ -; RUN: FileCheck %s --check-prefix=CHECK-O +; RUN: -enable-ppc-pcrel-tls -o %t.o < %s +; RUN: llvm-objdump --mcpu=pwr10 -dr %t.o | FileCheck %s --check-prefix=CHECK-O +; RUN: llvm-readelf -s %t.o | FileCheck %s --check-prefix=CHECK-SYM ; These test cases are to ensure that when using pc relative memory operations ; ABI correct code and relocations are produced for Initial Exec TLS Model. @@ -42,6 +43,9 @@ ; CHECK-O-NEXT: 2e 68 63 7c lwzx 3, 3, 13 ; CHECK-O-NEXT: 0000000000000029: R_PPC64_TLS x ; CHECK-O-NEXT: 20 00 80 4e blr + +; CHECK-SYM-LABEL: Symbol table '.symtab' contains 6 entries +; CHECK-SYM: 5: 0000000000000000 0 TLS GLOBAL DEFAULT UND x entry: %0 = load i32, i32* @x, align 4 ret i32 %0