[llvm-commits] [llvm] PPC64 ELF defines
Roman Divacky
rdivacky at freebsd.org
Tue Aug 14 11:28:07 PDT 2012
Somehow you managed to include the changes in the patch twice.
Are you sure otherwise the patch is correct/complete? Please
recheck that.
Otherwise it looks correct to me.
On Tue, Aug 14, 2012 at 03:07:39PM -0300, Adhemerval Zanella wrote:
> This patch adds the PPC64 defines for llvm-objdump, llvm-dwarfdump, and llvm-readobj,
> as well the PPC64 relocations values (I didn't cover all of them, but I'm planning
> to do so when support is add).
>
> --
> Adhemerval Zanella Netto
> Software Engineer
> Linux Technology Center Brazil
> Toolchain / GLIBC on Power Architecture
> azanella at linux.vnet.ibm.com / azanella at br.ibm.com
> +55 61 8642-9890
>
> Index: include/llvm/Object/ELF.h
> Index: include/llvm/Object/ELF.h
> ===================================================================
> --- include/llvm/Object/ELF.h (revision 161879)
> +++ include/llvm/Object/ELF.h (working copy)
> @@ -2015,6 +2015,8 @@
> return "ELF32-arm";
> case ELF::EM_HEXAGON:
> return "ELF32-hexagon";
> + case ELF::EM_PPC:
> + return "ELF32-ppc";
> default:
> return "ELF32-unknown";
> }
> @@ -2024,6 +2026,8 @@
> return "ELF64-i386";
> case ELF::EM_X86_64:
> return "ELF64-x86-64";
> + case ELF::EM_PPC64:
> + return "ELF64-ppc64";
> default:
> return "ELF64-unknown";
> }
> @@ -2044,6 +2048,10 @@
> return Triple::arm;
> case ELF::EM_HEXAGON:
> return Triple::hexagon;
> + case ELF::EM_PPC:
> + return Triple::ppc;
> + case ELF::EM_PPC64:
> + return Triple::ppc64;
> default:
> return Triple::UnknownArch;
> }
> Index: include/llvm/MC/MCExpr.h
> ===================================================================
> --- include/llvm/MC/MCExpr.h (revision 161879)
> +++ include/llvm/MC/MCExpr.h (working copy)
> @@ -171,7 +171,8 @@
> VK_ARM_GOTTPOFF,
> VK_ARM_TARGET1,
>
> - VK_PPC_TOC,
> + VK_PPC_TOC, // TOC base
> + VK_PPC_TOC_ENTRY, // TOC entry
> VK_PPC_DARWIN_HA16, // ha16(symbol)
> VK_PPC_DARWIN_LO16, // lo16(symbol)
> VK_PPC_GAS_HA16, // symbol at ha
> Index: include/llvm/Support/ELF.h
> ===================================================================
> --- include/llvm/Support/ELF.h (revision 161879)
> +++ include/llvm/Support/ELF.h (working copy)
> @@ -441,6 +441,7 @@
> R_MICROBLAZE_COPY = 21
> };
>
> +// ELF Relocation types for PPC32
> enum {
> R_PPC_NONE = 0, /* No relocation. */
> R_PPC_ADDR32 = 1,
> @@ -459,6 +460,21 @@
> R_PPC_REL32 = 26
> };
>
> +// ELF Relocation types for PPC64
> +enum {
> + R_PPC64_ADDR16_LO = 4,
> + R_PPC64_ADDR16_HA = 6,
> + R_PPC64_ADDR14 = 7,
> + R_PPC64_REL24 = 10,
> + R_PPC64_ADDR64 = 38,
> + R_PPC64_TOC16 = 47,
> + R_PPC64_TOC16_LO = 48,
> + R_PPC64_TOC16_HI = 49,
> + R_PPC64_TOC16_HA = 50,
> + R_PPC64_TOC = 51,
> + R_PPC64_TOC16_DS = 63
> +};
> +
> // ARM Specific e_flags
> enum { EF_ARM_EABIMASK = 0xFF000000U };
>
> ===================================================================
> --- include/llvm/Object/ELF.h (revision 161879)
> +++ include/llvm/Object/ELF.h (working copy)
> @@ -2015,6 +2015,8 @@
> return "ELF32-arm";
> case ELF::EM_HEXAGON:
> return "ELF32-hexagon";
> + case ELF::EM_PPC:
> + return "ELF32-ppc";
> default:
> return "ELF32-unknown";
> }
> @@ -2024,6 +2026,8 @@
> return "ELF64-i386";
> case ELF::EM_X86_64:
> return "ELF64-x86-64";
> + case ELF::EM_PPC64:
> + return "ELF64-ppc64";
> default:
> return "ELF64-unknown";
> }
> @@ -2044,6 +2048,10 @@
> return Triple::arm;
> case ELF::EM_HEXAGON:
> return Triple::hexagon;
> + case ELF::EM_PPC:
> + return Triple::ppc;
> + case ELF::EM_PPC64:
> + return Triple::ppc64;
> default:
> return Triple::UnknownArch;
> }
> Index: include/llvm/MC/MCExpr.h
> ===================================================================
> --- include/llvm/MC/MCExpr.h (revision 161879)
> +++ include/llvm/MC/MCExpr.h (working copy)
> @@ -171,7 +171,8 @@
> VK_ARM_GOTTPOFF,
> VK_ARM_TARGET1,
>
> - VK_PPC_TOC,
> + VK_PPC_TOC, // TOC base
> + VK_PPC_TOC_ENTRY, // TOC entry
> VK_PPC_DARWIN_HA16, // ha16(symbol)
> VK_PPC_DARWIN_LO16, // lo16(symbol)
> VK_PPC_GAS_HA16, // symbol at ha
> Index: include/llvm/Support/ELF.h
> ===================================================================
> --- include/llvm/Support/ELF.h (revision 161879)
> +++ include/llvm/Support/ELF.h (working copy)
> @@ -441,6 +441,7 @@
> R_MICROBLAZE_COPY = 21
> };
>
> +// ELF Relocation types for PPC32
> enum {
> R_PPC_NONE = 0, /* No relocation. */
> R_PPC_ADDR32 = 1,
> @@ -459,6 +460,21 @@
> R_PPC_REL32 = 26
> };
>
> +// ELF Relocation types for PPC64
> +enum {
> + R_PPC64_ADDR16_LO = 4,
> + R_PPC64_ADDR16_HA = 6,
> + R_PPC64_ADDR14 = 7,
> + R_PPC64_REL24 = 10,
> + R_PPC64_ADDR64 = 38,
> + R_PPC64_TOC16 = 47,
> + R_PPC64_TOC16_LO = 48,
> + R_PPC64_TOC16_HI = 49,
> + R_PPC64_TOC16_HA = 50,
> + R_PPC64_TOC = 51,
> + R_PPC64_TOC16_DS = 63
> +};
> +
> // ARM Specific e_flags
> enum { EF_ARM_EABIMASK = 0xFF000000U };
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list