diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-04-07 23:12:20 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-04-07 23:12:20 +0000 |
commit | de6256c93843467da3dfe16d02a92ed66f762c2d (patch) | |
tree | 24db2e7bf6b319b1acd9a7377832a96767c98c82 /include/llvm | |
parent | b9a65fd0028acd588f8382a50f7271e332fc363d (diff) | |
download | llvm-de6256c93843467da3dfe16d02a92ed66f762c2d.tar.gz llvm-de6256c93843467da3dfe16d02a92ed66f762c2d.tar.bz2 llvm-de6256c93843467da3dfe16d02a92ed66f762c2d.tar.xz |
obj2yaml: Use the correct relocation type for different machine types
The IO normalizer would essentially lump I386 and AMD64 relocations
together. Relocation types with the same numeric value would then get
mapped in appropriately.
For example:
IMAGE_REL_AMD64_ADDR64 and IMAGE_REL_I386_DIR16 both have a numeric
value of one. We would see IMAGE_REL_I386_DIR16 in obj2yaml conversions
of object files with a machine type of IMAGE_FILE_MACHINE_AMD64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Object/COFFYAML.h | 9 | ||||
-rw-r--r-- | include/llvm/Support/COFF.h | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/include/llvm/Object/COFFYAML.h b/include/llvm/Object/COFFYAML.h index b5f9cccf85..3f48e07f57 100644 --- a/include/llvm/Object/COFFYAML.h +++ b/include/llvm/Object/COFFYAML.h @@ -121,8 +121,13 @@ struct ScalarEnumerationTraits<COFF::SymbolComplexType> { }; template <> -struct ScalarEnumerationTraits<COFF::RelocationTypeX86> { - static void enumeration(IO &IO, COFF::RelocationTypeX86 &Value); +struct ScalarEnumerationTraits<COFF::RelocationTypeI386> { + static void enumeration(IO &IO, COFF::RelocationTypeI386 &Value); +}; + +template <> +struct ScalarEnumerationTraits<COFF::RelocationTypeAMD64> { + static void enumeration(IO &IO, COFF::RelocationTypeAMD64 &Value); }; template <> diff --git a/include/llvm/Support/COFF.h b/include/llvm/Support/COFF.h index dca7fc6ee8..f0e5c7dc62 100644 --- a/include/llvm/Support/COFF.h +++ b/include/llvm/Support/COFF.h @@ -275,7 +275,7 @@ namespace COFF { uint16_t Type; }; - enum RelocationTypeX86 { + enum RelocationTypeI386 { IMAGE_REL_I386_ABSOLUTE = 0x0000, IMAGE_REL_I386_DIR16 = 0x0001, IMAGE_REL_I386_REL16 = 0x0002, @@ -286,8 +286,10 @@ namespace COFF { IMAGE_REL_I386_SECREL = 0x000B, IMAGE_REL_I386_TOKEN = 0x000C, IMAGE_REL_I386_SECREL7 = 0x000D, - IMAGE_REL_I386_REL32 = 0x0014, + IMAGE_REL_I386_REL32 = 0x0014 + }; + enum RelocationTypeAMD64 { IMAGE_REL_AMD64_ABSOLUTE = 0x0000, IMAGE_REL_AMD64_ADDR64 = 0x0001, IMAGE_REL_AMD64_ADDR32 = 0x0002, |