summaryrefslogtreecommitdiff
path: root/elf/dl-reloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-reloc.c')
-rw-r--r--elf/dl-reloc.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 52311f0278..926056269a 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -306,14 +306,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
textrels = textrels->next;
}
-
- /* In case we can protect the data now that the relocations are
- done, do it. */
- if (l->l_relro_size != 0)
- _dl_protect_relro (l);
}
-
void internal_function
_dl_protect_relro (struct link_map *l)
{
@@ -333,6 +327,20 @@ cannot apply additional memory protection after relocation");
}
}
+void internal_function
+_dl_relocate_apply_relro (struct link_map *new)
+{
+ struct link_map **lp = new->l_searchlist.r_list;
+ struct link_map **end = lp + new->l_searchlist.r_nlist;
+ for (; lp < end; ++lp)
+ {
+ struct link_map *l = *lp;
+ if (l->l_relro_size)
+ _dl_protect_relro (l);
+ }
+}
+
+
void
internal_function __attribute_noinline__
_dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt)