Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Fix __gnu_Unwind_Find_exidx again.
Browse files Browse the repository at this point in the history
The math on the size calculation was wrong as the type of
__exidx_start/__exidx_end was unsigned rather than a char. Make a
struct that represents each item instead and remove the division.

Test: built artifacts and used them in the NDK
Bug: None
Change-Id: Ic2c0c123a369b9319e8645d806d659290eb2f69c
  • Loading branch information
DanAlbert committed Feb 7, 2018
1 parent 177429c commit 55ca56c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libc/arch-arm/bionic/exidx_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@
* EXIDX section.
*/

extern unsigned __exidx_end;
extern unsigned __exidx_start;
struct exidx_entry {
uint32_t key;
uint32_t value;
};

extern struct exidx_entry __exidx_end;
extern struct exidx_entry __exidx_start;

_Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr pc __attribute__((unused)), int* pcount) {
*pcount = (&__exidx_end - &__exidx_start) / 8;
*pcount = (&__exidx_end - &__exidx_start);
return (_Unwind_Ptr)&__exidx_start;
}

0 comments on commit 55ca56c

Please sign in to comment.