X-Git-Url: https://git.saurik.com/apple/ld64.git/blobdiff_plain/9543cb2f21e50a417dc8cf37eb7173f353536979..HEAD:/src/ld/parsers/libunwind/DwarfInstructions.hpp diff --git a/src/ld/parsers/libunwind/DwarfInstructions.hpp b/src/ld/parsers/libunwind/DwarfInstructions.hpp index a37c8a0..711def8 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 { /// @@ -166,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]); + }; @@ -266,6 +275,10 @@ const char* DwarfInstructions::parseCFIs(A& addressSpace, pint_t ehSectionS break; } } + if ( pcRange == 0 ) { + warn(ref, pcStart, "FDE found for zero size function"); + break; + } //fprintf(stderr, "FDE for func at 0x%08X, alreadyHaveCU=%d\n", (uint32_t)entry->u.fdeInfo.function.targetAddress, alreadyHaveCU); if ( alreadyHaveCU && !forceDwarfConversion ) { if ( keepDwarfWhichHasCU ) @@ -1960,6 +1973,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