[libunwind] r297149 - Let arm_section_length store the number of bytes.

Ed Schouten via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 7 07:21:57 PST 2017


Author: ed
Date: Tue Mar  7 09:21:57 2017
New Revision: 297149

URL: http://llvm.org/viewvc/llvm-project?rev=297149&view=rev
Log:
Let arm_section_length store the number of bytes.

Exception section data that we extract for DWARF gets stored as the
offset and the number of bytes. For ARM exception info, we seem to
deviate from this by storing the number of entries. Attempt to make this
more consistent.

By storing the number of bytes, we can get rid of the EHTEntry structure
declared in AddressSpace.hpp. In UnwindCursor.hpp we already have
another structure declared for the same purpose.

Reviewed by:	Keith Walker
Differential Revision:	https://reviews.llvm.org/D30681

Modified:
    libunwind/trunk/src/AddressSpace.hpp
    libunwind/trunk/src/UnwindCursor.hpp

Modified: libunwind/trunk/src/AddressSpace.hpp
URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/AddressSpace.hpp?rev=297149&r1=297148&r2=297149&view=diff
==============================================================================
--- libunwind/trunk/src/AddressSpace.hpp (original)
+++ libunwind/trunk/src/AddressSpace.hpp Tue Mar  7 09:21:57 2017
@@ -35,15 +35,11 @@ namespace libunwind {
 #include "Registers.hpp"
 
 #if _LIBUNWIND_ARM_EHABI
-struct EHTEntry {
-  uint32_t functionOffset;
-  uint32_t unwindOpcodes;
-};
 #if defined(_LIBUNWIND_IS_BAREMETAL)
 // When statically linked on bare-metal, the symbols for the EH table are looked
 // up without going through the dynamic loader.
-extern EHTEntry __exidx_start;
-extern EHTEntry __exidx_end;
+extern char __exidx_start;
+extern char __exidx_end;
 #else
 #include <link.h>
 #endif // !defined(_LIBUNWIND_IS_BAREMETAL)
@@ -437,8 +433,7 @@ inline bool LocalAddressSpace::findUnwin
           } else if (phdr->p_type == PT_ARM_EXIDX) {
             uintptr_t exidx_start = pinfo->dlpi_addr + phdr->p_vaddr;
             cbdata->sects->arm_section = exidx_start;
-            cbdata->sects->arm_section_length = phdr->p_memsz /
-                                                sizeof(EHTEntry);
+            cbdata->sects->arm_section_length = phdr->p_memsz;
             found_hdr = true;
           }
         }

Modified: libunwind/trunk/src/UnwindCursor.hpp
URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindCursor.hpp?rev=297149&r1=297148&r2=297149&view=diff
==============================================================================
--- libunwind/trunk/src/UnwindCursor.hpp (original)
+++ libunwind/trunk/src/UnwindCursor.hpp Tue Mar  7 09:21:57 2017
@@ -693,7 +693,8 @@ struct EHABISectionIterator {
     return _Self(addressSpace, sects, 0);
   }
   static _Self end(A& addressSpace, const UnwindInfoSections& sects) {
-    return _Self(addressSpace, sects, sects.arm_section_length);
+    return _Self(addressSpace, sects,
+                 sects.arm_section_length / sizeof(EHABIIndexEntry));
   }
 
   EHABISectionIterator(A& addressSpace, const UnwindInfoSections& sects, size_t i)




More information about the cfe-commits mailing list