Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2019 18:56:05 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345019 - head/contrib/llvm/projects/libunwind/src
Message-ID:  <201903111856.x2BIu5X3048010@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Mon Mar 11 18:56:04 2019
New Revision: 345019
URL: https://svnweb.freebsd.org/changeset/base/345019

Log:
  Merge LLVM libunwind release_80 branch r355677 (effectively, 8.0.0 rc4).
  
  PR:		236062
  MFC after:	1 month
  X-MFC-With:	r344779

Modified:
  head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp
  head/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp
Directory Properties:
  head/contrib/llvm/projects/libunwind/   (props changed)

Modified: head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp
==============================================================================
--- head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp	Mon Mar 11 18:45:36 2019	(r345018)
+++ head/contrib/llvm/projects/libunwind/src/AddressSpace.hpp	Mon Mar 11 18:56:04 2019	(r345019)
@@ -534,11 +534,11 @@ inline bool LocalAddressSpace::findUnwindSections(pint
 #endif
             cbdata->sects->dwarf_index_section = eh_frame_hdr_start;
             cbdata->sects->dwarf_index_section_length = phdr->p_memsz;
-            EHHeaderParser<LocalAddressSpace>::decodeEHHdr(
+            found_hdr = EHHeaderParser<LocalAddressSpace>::decodeEHHdr(
                 *cbdata->addressSpace, eh_frame_hdr_start, phdr->p_memsz,
                 hdrInfo);
-            cbdata->sects->dwarf_section = hdrInfo.eh_frame_ptr;
-            found_hdr = true;
+            if (found_hdr)
+              cbdata->sects->dwarf_section = hdrInfo.eh_frame_ptr;
           }
         }
 

Modified: head/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp
==============================================================================
--- head/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp	Mon Mar 11 18:45:36 2019	(r345018)
+++ head/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp	Mon Mar 11 18:56:04 2019	(r345019)
@@ -36,7 +36,7 @@ template <typename A> class EHHeaderParser { (public)
     uint8_t table_enc;
   };
 
-  static void decodeEHHdr(A &addressSpace, pint_t ehHdrStart, pint_t ehHdrEnd,
+  static bool decodeEHHdr(A &addressSpace, pint_t ehHdrStart, pint_t ehHdrEnd,
                           EHHeaderInfo &ehHdrInfo);
   static bool findFDE(A &addressSpace, pint_t pc, pint_t ehHdrStart,
                       uint32_t sectionLength,
@@ -53,12 +53,14 @@ template <typename A> class EHHeaderParser { (public)
 };
 
 template <typename A>
-void EHHeaderParser<A>::decodeEHHdr(A &addressSpace, pint_t ehHdrStart,
+bool EHHeaderParser<A>::decodeEHHdr(A &addressSpace, pint_t ehHdrStart,
                                     pint_t ehHdrEnd, EHHeaderInfo &ehHdrInfo) {
   pint_t p = ehHdrStart;
   uint8_t version = addressSpace.get8(p++);
-  if (version != 1)
-    _LIBUNWIND_ABORT("Unsupported .eh_frame_hdr version");
+  if (version != 1) {
+    _LIBUNWIND_LOG0("Unsupported .eh_frame_hdr version");
+    return false;
+  }
 
   uint8_t eh_frame_ptr_enc = addressSpace.get8(p++);
   uint8_t fde_count_enc = addressSpace.get8(p++);
@@ -71,6 +73,8 @@ void EHHeaderParser<A>::decodeEHHdr(A &addressSpace, p
           ? 0
           : addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart);
   ehHdrInfo.table = p;
+
+  return true;
 }
 
 template <typename A>
@@ -102,7 +106,9 @@ bool EHHeaderParser<A>::findFDE(A &addressSpace, pint_
   pint_t ehHdrEnd = ehHdrStart + sectionLength;
 
   EHHeaderParser<A>::EHHeaderInfo hdrInfo;
-  EHHeaderParser<A>::decodeEHHdr(addressSpace, ehHdrStart, ehHdrEnd, hdrInfo);
+  if (!EHHeaderParser<A>::decodeEHHdr(addressSpace, ehHdrStart, ehHdrEnd,
+                                      hdrInfo))
+    return false;
 
   size_t tableEntrySize = getTableEntrySize(hdrInfo.table_enc);
   pint_t tableEntry;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903111856.x2BIu5X3048010>