X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/f80fe69f3f29962e8aa43a99f8ed9201548f3d78..dd9e569f384b2c941bcc73d89d1468756788ee5b:/src/ld/parsers/libunwind/DwarfInstructions.hpp?ds=inline
diff --git a/src/ld/parsers/libunwind/DwarfInstructions.hpp b/src/ld/parsers/libunwind/DwarfInstructions.hpp
index c67a237..c14c38f 100644
--- a/src/ld/parsers/libunwind/DwarfInstructions.hpp
+++ b/src/ld/parsers/libunwind/DwarfInstructions.hpp
@@ -51,6 +51,7 @@
#define CFI_INVALID_ADDRESS ((pint_t)(-1))
+
namespace libunwind {
///
@@ -95,7 +96,8 @@ public:
typedef typename A::sint_t sint_t;
static const char* parseCFIs(A& addressSpace, pint_t ehSectionStart, uint32_t sectionLength,
- const pint_t cuStarts[], uint32_t cuCount, bool keepDwarfWhichHasCU, bool forceDwarfConversion,
+ const pint_t cuStarts[], uint32_t cuCount,
+ bool keepDwarfWhichHasCU, bool forceDwarfConversion, bool neverConvertToCU,
CFI_Atom_Info* infos, uint32_t& infosCount, void* ref, WarnFunc warn);
@@ -165,6 +167,14 @@ private:
const Registers_arm64&, const typename CFI_Parser::PrologInfo& prolog,
char warningBuffer[1024]);
+ // arm specific variants
+ static bool isReturnAddressRegister(int regNum, const Registers_arm&);
+ static pint_t getCFA(A& addressSpace, const typename CFI_Parser::PrologInfo& prolog, const Registers_arm&);
+ static compact_unwind_encoding_t encodeToUseDwarf(const Registers_arm&);
+ static compact_unwind_encoding_t createCompactEncodingFromProlog(A& addressSpace, pint_t funcAddr,
+ const Registers_arm&, const typename CFI_Parser::PrologInfo& prolog,
+ char warningBuffer[1024]);
+
};
@@ -172,7 +182,8 @@ private:
template
const char* DwarfInstructions::parseCFIs(A& addressSpace, pint_t ehSectionStart, uint32_t sectionLength,
- const pint_t cuStarts[], uint32_t cuCount, bool keepDwarfWhichHasCU, bool forceDwarfConversion,
+ const pint_t cuStarts[], uint32_t cuCount,
+ bool keepDwarfWhichHasCU, bool forceDwarfConversion, bool neverConvertToCU,
CFI_Atom_Info* infos, uint32_t& infosCount, void* ref, WarnFunc warn)
{
typename CFI_Parser::CIE_Info cieInfo;
@@ -270,7 +281,7 @@ const char* DwarfInstructions::parseCFIs(A& addressSpace, pint_t ehSectionS
++entry;
}
else {
- if ( (cuCount != 0) && !forceDwarfConversion ) {
+ if ( neverConvertToCU || ((cuCount != 0) && !forceDwarfConversion) ) {
// Have some compact unwind, so this is a new .o file, therefore anything without
// compact unwind must be something not expressable in compact unwind.
R dummy;
@@ -1958,6 +1969,30 @@ compact_unwind_encoding_t DwarfInstructions::createCompactEncodingFromProlo
return encoding;
}
+
+
+
+//
+// arm specific functions
+//
+
+template
+compact_unwind_encoding_t DwarfInstructions::encodeToUseDwarf(const Registers_arm&)
+{
+ return UNWIND_ARM_MODE_DWARF;
+}
+
+
+template
+compact_unwind_encoding_t DwarfInstructions::createCompactEncodingFromProlog(A& addressSpace, pint_t funcAddr,
+ const Registers_arm& r, const typename CFI_Parser::PrologInfo& prolog,
+ char warningBuffer[1024])
+{
+ warningBuffer[0] = '\0';
+ return UNWIND_ARM_MODE_DWARF;
+}
+
+
} // namespace libunwind