llvm.org GIT mirror llvm / 4db329e
Merging r317470: ------------------------------------------------------------------------ r317470 | sdardis | 2017-11-06 02:50:04 -0800 (Mon, 06 Nov 2017) | 12 lines [mips] Fix PR35140 Mark all symbols involved with TLS relocations as being TLS symbols. This resolves PR35140. Thanks to Alex Crichton for reporting the issue! Reviewers: atanasyan Differential Revision: https://reviews.llvm.org/D39591 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@318188 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 1 year, 9 months ago
2 changed file(s) with 32 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
245245 break;
246246 case MEK_CALL_HI16:
247247 case MEK_CALL_LO16:
248 case MEK_DTPREL_HI:
249 case MEK_DTPREL_LO:
250248 case MEK_GOT:
251249 case MEK_GOT_CALL:
252250 case MEK_GOT_DISP:
262260 case MEK_NEG:
263261 case MEK_PCREL_HI16:
264262 case MEK_PCREL_LO16:
265 case MEK_TLSLDM:
266263 // If we do have nested target-specific expressions, they will be in
267264 // a consecutive chain.
268265 if (const MipsMCExpr *E = dyn_cast(getSubExpr()))
269266 E->fixELFSymbolsInTLSFixups(Asm);
270267 break;
268 case MEK_DTPREL_HI:
269 case MEK_DTPREL_LO:
270 case MEK_TLSLDM:
271 case MEK_TLSGD:
271272 case MEK_GOTTPREL:
272 case MEK_TLSGD:
273273 case MEK_TPREL_HI:
274274 case MEK_TPREL_LO:
275275 fixELFSymbolsInTLSFixupsImpl(getSubExpr(), Asm);
0 # RUN: llvm-mc -arch=mips < %s -position-independent -filetype=obj \
1 # RUN: | llvm-readelf -symbols | FileCheck %s
2 # RUN: llvm-mc -arch=mips < %s -filetype=obj | llvm-readelf -symbols \
3 # RUN: | FileCheck %s
4
5 # Test that TLS relocations cause symbols to be marked as TLS symbols.
6
7 .set noat
8 lui $3, %tlsgd(foo1)
9 lui $1, %dtprel_hi(foo2)
10 lui $1, %dtprel_lo(foo3)
11 lui $1, %tprel_hi(foo4)
12 lui $1, %tprel_lo(foo5)
13 lw $2, %gottprel(foo6)($28)
14
15 .hidden foo1
16 .hidden foo2
17 .hidden foo3
18 .hidden foo4
19 .hidden foo5
20 .hidden foo6
21
22 # CHECK: 1: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo1
23 # CHECK: 2: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo2
24 # CHECK: 3: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo3
25 # CHECK: 4: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo4
26 # CHECK: 5: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo5
27 # CHECK: 6: {{.+}} {{.+}} TLS GLOBAL HIDDEN UND foo6