From 42734cfb4140287d59d3b35718d62b5f90737499 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 30 Mar 2013 16:21:50 +0000 Subject: Change '@SECREL' suffix to GAS-compatible '@SECREL32'. '@SECREL' is what is used by the Microsoft assembler, but GNU as expects '@SECREL32'. With the patch, the MC-generated code works fine in combination with a recent GNU as (2.23.51.20120920 here). Patch by David Nadlinger! Differential Revision: http://llvm-reviews.chandlerc.com/D429 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178427 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/MC/MCExpr.cpp') diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index 1a53934..cd4d144 100644 --- a/lib/MC/MCExpr.cpp +++ b/lib/MC/MCExpr.cpp @@ -194,7 +194,7 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) { case VK_TPOFF: return "TPOFF"; case VK_DTPOFF: return "DTPOFF"; case VK_TLVP: return "TLVP"; - case VK_SECREL: return "SECREL"; + case VK_SECREL: return "SECREL32"; case VK_ARM_NONE: return "(NONE)"; case VK_ARM_PLT: return "(PLT)"; case VK_ARM_GOT: return "(GOT)"; -- cgit v1.1 From 18d49acdab79d6f0966b47182b6c3a2ba3d9f80f Mon Sep 17 00:00:00 2001 From: Nico Rieck Date: Wed, 10 Apr 2013 23:28:17 +0000 Subject: MC: Support COFF image-relative MCSymbolRefs Add support for the COFF relocation types IMAGE_REL_I386_DIR32NB and IMAGE_REL_AMD64_ADDR32NB for 32- and 64-bit respectively. These are similar to normal 4-byte relocations except that they do not include the base address of the image. Image-relative relocations are used for debug information (32-bit) and SEH unwind tables (64-bit). A new MCSymbolRef variant called 'VK_COFF_IMGREL32' is introduced to specify such relocations. For AT&T assembly, this variant can be accessed using the symbol suffix '@imgrel'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179240 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCExpr.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/MC/MCExpr.cpp') diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index cd4d144..d54c264 100644 --- a/lib/MC/MCExpr.cpp +++ b/lib/MC/MCExpr.cpp @@ -250,6 +250,7 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) { case VK_Mips_GOT_LO16: return "GOT_LO16"; case VK_Mips_CALL_HI16: return "CALL_HI16"; case VK_Mips_CALL_LO16: return "CALL_LO16"; + case VK_COFF_IMGREL32: return "IMGREL32"; } llvm_unreachable("Invalid variant kind"); } @@ -285,6 +286,8 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) { .Case("dtpoff", VK_DTPOFF) .Case("TLVP", VK_TLVP) .Case("tlvp", VK_TLVP) + .Case("IMGREL", VK_COFF_IMGREL32) + .Case("imgrel", VK_COFF_IMGREL32) .Default(VK_Invalid); } -- cgit v1.1 From 93d0b06e2adca2d9f3d4ec544f352cc4e5e9618a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 25 Apr 2013 19:27:05 +0000 Subject: Fix section relocation for SECTIONREL32 with immediate offset. Patch by Kai Nacke. This matches the gnu as output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180568 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCExpr.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/MC/MCExpr.cpp') diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index d54c264..6cde26c 100644 --- a/lib/MC/MCExpr.cpp +++ b/lib/MC/MCExpr.cpp @@ -288,6 +288,8 @@ MCSymbolRefExpr::getVariantKindForName(StringRef Name) { .Case("tlvp", VK_TLVP) .Case("IMGREL", VK_COFF_IMGREL32) .Case("imgrel", VK_COFF_IMGREL32) + .Case("SECREL32", VK_SECREL) + .Case("secrel32", VK_SECREL) .Default(VK_Invalid); } -- cgit v1.1