[llvm-commits] [rfc][patch] How should we handle _GLOBAL_OFFSET_TABLE_?

Frits van Bommel fvbommel at gmail.com
Thu Oct 21 09:29:03 PDT 2010


2010/10/21 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
> The attached patch implements it. Is it OK?

@@ -229,10 +230,12 @@ EmitImmediate(const MCOperand &DispOp, unsigned
Size, MCFixupKind FixupKind,
   // If we have an immoffset, add it to the expression.
   const MCExpr *Expr = DispOp.getExpr();

-  if (StartsWithGlobalOffsetTable(Expr)) {
+  if (FixupKind == FK_Data_4 && StartsWithGlobalOffsetTable(Expr)) {
     // FIXME: We should probably change the FixupKind to a special one so that
     // other parts of MC don't have to check the symbol name.
     assert(ImmOffset == 0);
+
+    FixupKind = MCFixupKind(X86::reloc_global_offset_table);

You should probably also remove that FIXME.




More information about the llvm-commits mailing list