Revert "ARC: dw2 unwind: Ignore CIE version !=1 gracefully instead of bailing"
authorVineet Gupta <vgupta@synopsys.com>
Mon, 21 Dec 2015 07:59:44 +0000 (13:29 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 21 Dec 2015 07:59:44 +0000 (13:29 +0530)
Blingly ignoring CIE.version != 1 was a bad idea.
It still leaves "desirability" when running perf with callgraphing where libgcc
symbols might show in hotspot.

More importantly, basic CIE.version == 3 support already exists in code:

|
|   retAddrReg = state.version <= 1 ? *ptr++ : get_uleb128(&ptr, end);
|

Next commit with simply add continue-not-bail for CIE.version != 1

This reverts commit 323f41f9e7d0cb5b1d1586aded6682855f1e646d.

arch/arc/kernel/unwind.c

index cf2828a..9f9ecc1 100644 (file)
@@ -293,13 +293,13 @@ static void init_unwind_hdr(struct unwind_table *table,
                const u32 *cie = cie_for_fde(fde, table);
                signed ptrType;
 
                const u32 *cie = cie_for_fde(fde, table);
                signed ptrType;
 
-               if (cie == &not_fde)    /* only process FDE here */
+               if (cie == &not_fde)
                        continue;
                if (cie == NULL || cie == &bad_cie)
                        continue;
                if (cie == NULL || cie == &bad_cie)
-                       continue;       /* say FDE->CIE.version != 1 */
+                       return;
                ptrType = fde_pointer_type(cie);
                if (ptrType < 0)
                ptrType = fde_pointer_type(cie);
                if (ptrType < 0)
-                       continue;
+                       return;
 
                ptr = (const u8 *)(fde + 2);
                if (!read_pointer(&ptr, (const u8 *)(fde + 1) + *fde,
 
                ptr = (const u8 *)(fde + 2);
                if (!read_pointer(&ptr, (const u8 *)(fde + 1) + *fde,
@@ -343,10 +343,6 @@ static void init_unwind_hdr(struct unwind_table *table,
 
                if (fde[1] == 0xffffffff)
                        continue;       /* this is a CIE */
 
                if (fde[1] == 0xffffffff)
                        continue;       /* this is a CIE */
-
-               if (*(u8 *)(cie + 2) != 1)
-                       continue;       /* FDE->CIE.version not supported */
-
                ptr = (const u8 *)(fde + 2);
                header->table[n].start = read_pointer(&ptr,
                                                      (const u8 *)(fde + 1) +
                ptr = (const u8 *)(fde + 2);
                header->table[n].start = read_pointer(&ptr,
                                                      (const u8 *)(fde + 1) +
@@ -523,8 +519,7 @@ static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table)
 
        if (*cie <= sizeof(*cie) + 4 || *cie >= fde[1] - sizeof(*fde)
            || (*cie & (sizeof(*cie) - 1))
 
        if (*cie <= sizeof(*cie) + 4 || *cie >= fde[1] - sizeof(*fde)
            || (*cie & (sizeof(*cie) - 1))
-           || (cie[1] != 0xffffffff)
-           || ( *(u8 *)(cie + 2) != 1))   /* version 1 supported */
+           || (cie[1] != 0xffffffff))
                return NULL;    /* this is not a (valid) CIE */
        return cie;
 }
                return NULL;    /* this is not a (valid) CIE */
        return cie;
 }