[PATCH] Add parsing of 'foo at local".

Justin Hibbits jrh29 at alumni.cwru.edu
Mon Dec 15 18:21:22 PST 2014


Hi hfinkel,

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

http://reviews.llvm.org/D6672

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

Index: lib/MC/MCExpr.cpp
===================================================================
--- lib/MC/MCExpr.cpp
+++ lib/MC/MCExpr.cpp
@@ -353,6 +353,7 @@
     .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)
Index: test/MC/PowerPC/ppc-reloc.s
===================================================================
--- test/MC/PowerPC/ppc-reloc.s
+++ test/MC/PowerPC/ppc-reloc.s
@@ -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: ]

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6672.17315.patch
Type: text/x-patch
Size: 915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141216/822fc195/attachment.bin>


More information about the llvm-commits mailing list