[PATCH] D24471: [ELF] Set EF_ARM_EABI_VER5 for ARM

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 13:55:06 PDT 2016


mstorsjo created this revision.
mstorsjo added a reviewer: rui314.
mstorsjo added a subscriber: llvm-commits.
Herald added subscribers: samparker, rengolin, aemerson.

Without this flag set, an aarch64 kernel won't try to load the executable (even if a 32 bit arm kernel will run the binary just fine).

We could also set EF_ARM_VFP_FLOAT here, if hardfloat vs softfloat is easily known here.


https://reviews.llvm.org/D24471

Files:
  ELF/Writer.cpp

Index: ELF/Writer.cpp
===================================================================
--- ELF/Writer.cpp
+++ ELF/Writer.cpp
@@ -1264,6 +1264,8 @@
 
   if (Config->EMachine == EM_MIPS)
     EHdr->e_flags = getMipsEFlags<ELFT>();
+  else if (Config->EMachine == EM_ARM)
+    EHdr->e_flags = EF_ARM_EABI_VER5;
 
   if (!Config->Relocatable) {
     EHdr->e_phoff = sizeof(Elf_Ehdr);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24471.71051.patch
Type: text/x-patch
Size: 383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160912/32b2a4a7/attachment.bin>


More information about the llvm-commits mailing list