Add parsing of 'foo@local".
authorJustin Hibbits <jrh29@alumni.cwru.edu>
Wed, 17 Dec 2014 06:23:35 +0000 (06:23 +0000)
committerJustin Hibbits <jrh29@alumni.cwru.edu>
Wed, 17 Dec 2014 06:23:35 +0000 (06:23 +0000)
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

llvm-svn: 224415

llvm/lib/MC/MCExpr.cpp
llvm/test/MC/PowerPC/ppc-reloc.s

index 6e648b2..6b69d1c 100644 (file)
@@ -353,6 +353,7 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) {
     .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("TOCBASE", VK_PPC_TOCBASE)
     .Case("tocbase", VK_PPC_TOCBASE)
     .Case("TOC", VK_PPC_TOC)
index 19dd2a3..e7dd1e2 100644 (file)
@@ -7,11 +7,13 @@
        .align 2
 foo:
        bl printf@plt
+       bl _GLOBAL_OFFSET_TABLE_@local-4
 .LC1:
        .size foo, . - 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: ]