Deleted Added
sdiff udiff text old ( 153515 ) new ( 208256 )
full compact
1/* $NetBSD: mdreloc.c,v 1.23 2003/07/26 15:04:38 mrg Exp $ */
2
3#include <sys/cdefs.h>
4__FBSDID("$FreeBSD: head/libexec/rtld-elf/arm/reloc.c 208256 2010-05-18 08:55:23Z rdivacky $");
5#include <sys/param.h>
6#include <sys/mman.h>
7
8#include <errno.h>
9#include <stdio.h>
10#include <stdlib.h>
11#include <string.h>
12#include <unistd.h>

--- 227 unchanged lines hidden (view full) ---

240 * * Process non-PLT relocations
241 * */
242int
243reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld)
244{
245 const Elf_Rel *rellim;
246 const Elf_Rel *rel;
247 SymCache *cache;
248 int r = -1;
249
250 /* The relocation for the dynamic loader has already been done. */
251 if (obj == obj_rtld)
252 return (0);
253 /*
254 * The dynamic loader may be called from a thread, we have
255 * limited amounts of stack available so we cannot use alloca().
256 */
257 cache = calloc(obj->nchains, sizeof(SymCache));
258 /* No need to check for NULL here */
259
260 rellim = (const Elf_Rel *)((caddr_t)obj->rel + obj->relsize);
261 for (rel = obj->rel; rel < rellim; rel++) {
262 if (reloc_nonplt_object(obj, rel, cache) < 0)
263 goto done;
264 }
265 r = 0;
266done:
267 if (cache != NULL)
268 free(cache);
269 return (r);
270}
271
272/*
273 * * Process the PLT relocations.
274 * */
275int
276reloc_plt(Obj_Entry *obj)

--- 76 unchanged lines hidden ---