[PATCH] D22954: [ELF] Allow arbitrary code alignment in .eh_frame

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


phosek created this revision.
phosek added a subscriber: llvm-commits.
phosek added a project: lld.

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

https://reviews.llvm.org/D22954

Files:
  ELF/EhFrame.cpp

Index: ELF/EhFrame.cpp
===================================================================
--- ELF/EhFrame.cpp
+++ ELF/EhFrame.cpp
@@ -117,9 +117,8 @@
   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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22954.66076.patch
Type: text/x-patch
Size: 503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160729/d6cc5587/attachment.bin>


More information about the llvm-commits mailing list