Commit 07aef024 authored by Ryan V. Bissell's avatar Ryan V. Bissell
Browse files

gdb: fall-back to AT_BASE to get linker load addr

GDB needs two things from the runtime linker:
1. the address of .rtld_db_dlactivity.  It needs this so that it can
   resolve pending breakpoints, once the relevant solibs get loaded
   later on.
2. The relocated base address of the linker.  It uses this to compute
   the relocated extents of the '.text' and '.plt' sections of the
   linker (which are needed in order to properly support single-
   stepping through solib trampolines.)

The enable_break() function in GDB 7.x is responsible for obtaining
both of those things, and it employs multiple strategies to get them.
It just so happens that on Android (JB and earlier,) every single
strategy it employs fails (or else gets skipped over, errantly.)

On Jelly Bean and earlier, Android's /system/bin/linker errantly
reports that its own relocated base address is 0.  It also comes
completely stripped, so that rtld_db_dlactivity cannot be found by
symbol lookup.

As a workaround for these old linkers, we preserve intermediate results
from various failing strategies, to back-compute a final usable result.

Bug: http://code.google.com/p/android/issues/detail?id=34856


Signed-off-by: default avatarRyan V. Bissell <rbissell@nvidia.com>
parent ec406889
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment