[lld] r277105 - [ELF] Allow arbitrary code alignment in .eh_frame

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 21:41:38 PDT 2016


Author: phosek
Date: Thu Jul 28 23:41:38 2016
New Revision: 277105

URL: http://llvm.org/viewvc/llvm-project?rev=277105&view=rev
Log:
[ELF] Allow arbitrary code alignment in .eh_frame

According to the specification, CIE code alignment factor is an
arbitrary unsigned LEB128 encoded value.

Differential revision: https://reviews.llvm.org/D22954

Modified:
    lld/trunk/ELF/EhFrame.cpp

Modified: lld/trunk/ELF/EhFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/EhFrame.cpp?rev=277105&r1=277104&r2=277105&view=diff
==============================================================================
--- lld/trunk/ELF/EhFrame.cpp (original)
+++ lld/trunk/ELF/EhFrame.cpp Thu Jul 28 23:41:38 2016
@@ -117,9 +117,8 @@ template <class ELFT> uint8_t getFdeEnco
   StringRef Aug(reinterpret_cast<const char *>(D.begin()), AugEnd - D.begin());
   D = D.slice(Aug.size() + 1);
 
-  // Code alignment factor should always be 1 for .eh_frame.
-  if (readByte(D) != 1)
-    fatal("CIE code alignment must be 1");
+  // Skip code alignment factor.
+  skipLeb128(D);
 
   // Skip data alignment factor.
   skipLeb128(D);




More information about the llvm-commits mailing list