[llvm] r224415 - Add parsing of 'foo at local".

Justin Hibbits jrh29 at alumni.cwru.edu
Tue Dec 16 22:23:35 PST 2014


Author: jhibbits
Date: Wed Dec 17 00:23:35 2014
New Revision: 224415

URL: http://llvm.org/viewvc/llvm-project?rev=224415&view=rev
Log:
Add parsing of 'foo at 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

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

Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=224415&r1=224414&r2=224415&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Wed Dec 17 00:23:35 2014
@@ -353,6 +353,7 @@ MCSymbolRefExpr::getVariantKindForName(S
     .Case("got at h", VK_PPC_GOT_HI)
     .Case("GOT at HA", VK_PPC_GOT_HA)
     .Case("got at 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)

Modified: llvm/trunk/test/MC/PowerPC/ppc-reloc.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/PowerPC/ppc-reloc.s?rev=224415&r1=224414&r2=224415&view=diff
==============================================================================
--- llvm/trunk/test/MC/PowerPC/ppc-reloc.s (original)
+++ llvm/trunk/test/MC/PowerPC/ppc-reloc.s Wed Dec 17 00:23:35 2014
@@ -7,11 +7,13 @@
 	.align 2
 foo:
 	bl printf at plt
+	bl _GLOBAL_OFFSET_TABLE_ at 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: ]





More information about the llvm-commits mailing list