Add util for reading library name from elf binary
1. Reading elf for the current binary could lead to seg fault if the
full library is not loaded in memory. So, the util only takes mapped
address and works on it. The caller must ensure the library is
mapped.
2. Add function to read soname from the .dynamic section in elf file.
3. The Linux executable does not contain so name. So, use malloc_wrapper
library to test.
BUG=734705
Change-Id: I1327f4786726143daba57a2aaa1eddd608143c04
Reviewed-on: https://chromium-review.googlesource.com/1031854
Commit-Queue: Siddhartha S <ssid@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554635}
CrOS-Libchrome-Original-Commit: b7b4a541dc81ed20a32d086c23d57889e74ab1e4
3 files changed