diff options
author | Ryan Prichard <rprichard@google.com> | 2018-08-20 17:43:44 -0700 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2018-08-20 22:07:27 -0700 |
commit | 14dd9923b026c4500dc5b3f6f481b6bf1028778c (patch) | |
tree | eed9629618dd1ffc9d2071a121e2b701b6cb6cca /linker/linker_main.cpp | |
parent | 3fd45bba4857fdbf320b6e89d2ae0569d9463bf5 (diff) |
Move [vdso] after exe/linker in _r_debug
gdbserver assumes that the first entry is the exe, so it must come
first.
Fixes debugging of executables with gdb.
Bug: https://issuetracker.google.com/112627083
Bug: http://b/110967431
Test: gdbclient.py -r toybox
Change-Id: I7b30398d679c3f8b92d8d02572f9073ae0fce798
Diffstat (limited to 'linker/linker_main.cpp')
-rw-r--r-- | linker/linker_main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linker/linker_main.cpp b/linker/linker_main.cpp index 3410f9068..af4761990 100644 --- a/linker/linker_main.cpp +++ b/linker/linker_main.cpp @@ -289,8 +289,6 @@ static ElfW(Addr) linker_main(KernelArgumentBlock& args) { } } - add_vdso(args); - struct stat file_stat; // Stat "/proc/self/exe" instead of executable_path because // the executable could be unlinked by this point and it should @@ -320,6 +318,8 @@ static ElfW(Addr) linker_main(KernelArgumentBlock& args) { insert_link_map_into_debug_map(map); insert_link_map_into_debug_map(&linker_link_map); + add_vdso(args); + // Extract information passed from the kernel. si->phdr = reinterpret_cast<ElfW(Phdr)*>(args.getauxval(AT_PHDR)); si->phnum = args.getauxval(AT_PHNUM); |