|
@@ -700,9 +700,12 @@ postmap:
|
|
|
|
|
|
/* When we profile the SONAME might be needed for something else but
|
|
|
loading. Add it right away. */
|
|
|
- if (l->l_info[DT_STRTAB] && l->l_info[DT_SONAME])
|
|
|
- l->l_soname = (char *) (D_PTR (l->l_info[DT_STRTAB])
|
|
|
+ if (l->l_info[DT_STRTAB] && l->l_info[DT_SONAME]) {
|
|
|
+ /* DEP 3/12/18: This string is not stable; copy it. */
|
|
|
+ char * tmp = (char *) (D_PTR (l->l_info[DT_STRTAB])
|
|
|
+ D_PTR (l->l_info[DT_SONAME]));
|
|
|
+ l->l_soname = remalloc(tmp, strlen(tmp) + 1);
|
|
|
+ }
|
|
|
|
|
|
if (l->l_phdr == NULL) {
|
|
|
/* The program header is not contained in any of the segments.
|