1# REQUIRES: ppc
2# RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o
3# RUN: ld.lld %t.o %t.o -o /dev/null
4# RUN: ld.lld -r --fatal-warnings %t.o %t.o -o /dev/null
5
6## Similar to PPC64, clang/gcc PPC32 may emit a .rela.got2 which references a local symbol
7## defined in a discarded .rodata section. Unfortunately, .got2 cannot be placed in a comdat
8## because for lwz 3, .LC0-.LTOC(30), we cannot define .LC0 in a different .got2 section.
9
10## Don't error "relocation refers to a discarded section".
11
12.section .text.foo,"axG",@progbits,foo,comdat
13.globl foo
14foo:
15 lwz 3, .LC0-.LTOC(30)
16.L0:
17
18.section .got2,"aw",@progbits
19.set .LTOC, .got2+32768
20.LC0:
21.long .L0
22