aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/patches/patch-23-llvm-r224415-ppc-local.diff
blob: 9099743985ffcef59a65d0a799963f6e453434c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Pull in r224415 from upstream llvm trunk (by Justin Hibbits):

  Add parsing of 'foo@local".

  Summary:
  Currently, it supports generating, but not parsing, this expression.
  Test added as well.

  Test Plan: New test added, no regressions due to this.

  Reviewers: hfinkel

  Reviewed By: hfinkel

  Subscribers: llvm-commits

  Differential Revision: http://reviews.llvm.org/D6672

Pull in r224494 from upstream llvm trunk (by Justin Hibbits):

  Add a corresponding '@LOCAL' parse to match r224415.

  Pointed out by Jim Grosbach.

Introduced here: http://svnweb.freebsd.org/changeset/base/276223

Index: lib/MC/MCExpr.cpp
===================================================================
--- lib/MC/MCExpr.cpp
+++ lib/MC/MCExpr.cpp
@@ -348,6 +348,8 @@ MCSymbolRefExpr::getVariantKindForName(StringRef N
     .Case("got@h", VK_PPC_GOT_HI)
     .Case("GOT@HA", VK_PPC_GOT_HA)
     .Case("got@ha", VK_PPC_GOT_HA)
+    .Case("local", VK_PPC_LOCAL)
+    .Case("LOCAL", VK_PPC_LOCAL)
     .Case("TOCBASE", VK_PPC_TOCBASE)
     .Case("tocbase", VK_PPC_TOCBASE)
     .Case("TOC", VK_PPC_TOC)
Index: test/MC/PowerPC/ppc-reloc.s
===================================================================
--- test/MC/PowerPC/ppc-reloc.s
+++ test/MC/PowerPC/ppc-reloc.s
@@ -7,6 +7,7 @@
 	.align 2
 foo:
 	bl printf@plt
+	bl _GLOBAL_OFFSET_TABLE_@local-4
 .LC1:
 	.size foo, . - foo
 
@@ -13,5 +14,6 @@ foo:
 # CHECK:      Relocations [
 # CHECK-NEXT:   Section (2) .rela.text {
 # CHECK-NEXT:     0x0 R_PPC_PLTREL24 printf 0x0
+# CHECK-NEXT:     0x4 R_PPC_LOCAL24PC _GLOBAL_OFFSET_TABLE_ 0xFFFFFFFC
 # CHECK-NEXT:   }
 # CHECK-NEXT: ]