Skip to content

Commit

Permalink
Fix __gnu_Unwind_Find_exidx for static executables.
Browse files Browse the repository at this point in the history
__exidx_start and __exidx_end are not actual values to be read, just
symbols placed before and after .ARM.exidx.

The default linker script for ARM static executables includes these
lines:

    __exidx_start = .;
   .ARM.exidx   : { *(.ARM.exidx*) }
    __exidx_end = .;

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0474c/BABEHEDA.html

Test: used __gnu_Unwind_Find_exidx in a static executable and showed
      non-bogus values
Bug: android/ndk#593
Change-Id: Ib35a4b6c82920666ae8a45aa0a2d43e458699b51
  • Loading branch information
DanAlbert committed Jan 25, 2018
1 parent 73871ad commit 0414f5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libc/arch-arm/bionic/exidx_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ extern unsigned __exidx_start;
_Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr pc __attribute__((unused)),
int *pcount)
{
*pcount = (__exidx_end-__exidx_start)/8;
return (_Unwind_Ptr)__exidx_start;
*pcount = (&__exidx_end-&__exidx_start)/8;
return (_Unwind_Ptr)&__exidx_start;
}

0 comments on commit 0414f5b

Please sign in to comment.