|
@@ -735,47 +735,6 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
|
|
|
return tpnt;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- relocations for global variables that are present both in the image and
|
|
|
- the shared library. Go through and do it manually. If the images
|
|
|
- are guaranteed to be generated by a trustworthy linker, then this
|
|
|
- step can be skipped. */
|
|
|
-
|
|
|
-int _dl_copy_fixups(struct dyn_elf *rpnt)
|
|
|
-{
|
|
|
- int goof = 0;
|
|
|
- struct elf_resolve *tpnt;
|
|
|
-
|
|
|
- if (rpnt->next)
|
|
|
- goof += _dl_copy_fixups(rpnt->next);
|
|
|
- else
|
|
|
- return 0;
|
|
|
-
|
|
|
- tpnt = rpnt->dyn;
|
|
|
-
|
|
|
- if (tpnt->init_flag & COPY_RELOCS_DONE)
|
|
|
- return goof;
|
|
|
- tpnt->init_flag |= COPY_RELOCS_DONE;
|
|
|
-
|
|
|
-#if defined (__SUPPORT_LD_DEBUG__)
|
|
|
- if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation copy fixups: %s", tpnt->libname);
|
|
|
-#endif
|
|
|
-
|
|
|
-#ifdef ELF_USES_RELOCA
|
|
|
- goof += _dl_parse_copy_information(rpnt,
|
|
|
- tpnt->dynamic_info[DT_RELA], tpnt->dynamic_info[DT_RELASZ], 0);
|
|
|
-
|
|
|
-#else
|
|
|
- goof += _dl_parse_copy_information(rpnt, tpnt->dynamic_info[DT_REL],
|
|
|
- tpnt->dynamic_info[DT_RELSZ], 0);
|
|
|
-
|
|
|
-#endif
|
|
|
-#if defined (__SUPPORT_LD_DEBUG__)
|
|
|
- if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation copy fixups: %s; finished\n\n", tpnt->libname);
|
|
|
-#endif
|
|
|
- return goof;
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
void _dl_dprintf(int fd, const char *fmt, ...)
|
|
|
{
|
|
@@ -905,12 +864,15 @@ void *_dl_malloc(int size)
|
|
|
return retval;
|
|
|
}
|
|
|
|
|
|
-int _dl_fixup(struct elf_resolve *tpnt, int flag)
|
|
|
+int _dl_fixup(struct dyn_elf *rpnt, int flag)
|
|
|
{
|
|
|
int goof = 0;
|
|
|
+ struct elf_resolve *tpnt;
|
|
|
+
|
|
|
+ if (rpnt->next)
|
|
|
+ goof += _dl_fixup(rpnt->next, flag);
|
|
|
+ tpnt = rpnt->dyn;
|
|
|
|
|
|
- if (tpnt->next)
|
|
|
- goof += _dl_fixup(tpnt->next, flag);
|
|
|
#if defined (__SUPPORT_LD_DEBUG__)
|
|
|
if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);
|
|
|
#endif
|
|
@@ -961,6 +923,19 @@ int _dl_fixup(struct elf_resolve *tpnt, int flag)
|
|
|
tpnt->dynamic_info[DT_PLTRELSZ], 0);
|
|
|
}
|
|
|
}
|
|
|
+ if (tpnt->init_flag & COPY_RELOCS_DONE)
|
|
|
+ return goof;
|
|
|
+ tpnt->init_flag |= COPY_RELOCS_DONE;
|
|
|
+#ifdef ELF_USES_RELOCA
|
|
|
+ goof += _dl_parse_copy_information(rpnt,
|
|
|
+ tpnt->dynamic_info[DT_RELA], tpnt->dynamic_info[DT_RELASZ], 0);
|
|
|
+
|
|
|
+#else
|
|
|
+ goof += _dl_parse_copy_information(rpnt, tpnt->dynamic_info[DT_REL],
|
|
|
+ tpnt->dynamic_info[DT_RELSZ], 0);
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
#if defined (__SUPPORT_LD_DEBUG__)
|
|
|
if(_dl_debug) {
|
|
|
_dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);
|
|
@@ -970,4 +945,3 @@ int _dl_fixup(struct elf_resolve *tpnt, int flag)
|
|
|
return goof;
|
|
|
}
|
|
|
|
|
|
-
|