[PATCH] Ensure FDE reads the correct CIE when relocating the LSDA.

kledzik at apple.com kledzik at apple.com
Thu May 14 16:38:24 PDT 2015


I like to have lots of little test cases that are pruned down to just test a specific area.  In this case, there should be a separate test for _eh_frame section with multiple CIEs.  In the test case, you don't need the __compact_unwind section. You don't need code or relocations on the code.


REPOSITORY
  rL LLVM

================
Comment at: lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp:739-744
@@ -732,6 +738,8 @@
   Reference::Addend addend;
-  const Atom *cie =
+  const MachODefinedAtom *cie =
     findAtomCoveringAddress(normalizedFile, file, cieAddress, &addend);
   atom->addReference(cieFieldInFDE, handler.unwindRefToCIEKind(), cie,
                      addend, handler.kindArch());
 
+  const CIEInfo &cieInfo = cieInfos.find(cie)->second;
+
----------------
More error handling in case the FDE is malformed. Ex: There is no atom at that address, the address is not the start of the atom, or the atom is not a CIE atom.

http://reviews.llvm.org/D9783

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list