From 82d0c09944e0fa5d22700337b9a8e1c7ae17ea55 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 8 Feb 1999 10:08:45 +0000 Subject: Update. * po/el.po: New file. 1999-02-07 Andreas Schwab * elf/dl-load.c (_dl_map_object_from_fd): Replace magic constant when processing DT_SYMBOLIC objects. 1999-02-07 Andreas Schwab * elf/dl-load.c (_dl_map_object_from_fd): When looking for the program headers without PT_PHDR only require that they are contained within one of the loaded segments. Don't use assert, since that would be a bug in the object, not the dynamic linker. 1999-02-08 Richard Henderson * sysdeps/alpha/dl-machine.h (TRAMPOLINE_TEMPLATE): Save and restore all call-clobbered fp regs. 1999-02-08 Ulrich Drepper --- elf/dl-load.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'elf/dl-load.c') diff --git a/elf/dl-load.c b/elf/dl-load.c index 07ac3597..84951ea 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -864,11 +864,18 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname, { /* There was no PT_PHDR specified. We need to find the phdr in the load image ourselves. We assume it is in fact in the load image - somewhere, and that the first load command starts at the - beginning of the file and thus contains the ELF file header. */ - ElfW(Addr) bof = l->l_addr + loadcmds[0].mapstart; - assert (loadcmds[0].mapoff == 0); - l->l_phdr = (void *) (bof + ((const ElfW(Ehdr) *) bof)->e_phoff); + somewhere. */ + for (c = loadcmds; c < &loadcmds[nloadcmds]; c++) + if (c->mapoff <= header->e_phoff + && (c->mapend - c->mapstart + c->mapoff + >= header->e_phoff + header->e_phnum * sizeof (ElfW(Phdr)))) + { + ElfW(Addr) bof = l->l_addr + c->mapstart; + l->l_phdr = (void *) (bof + header->e_phoff - c->mapoff); + break; + } + if (l->l_phdr == 0) + LOSE ("program headers not contained in any loaded segment"); } else /* Adjust the PT_PHDR value by the runtime load address. */ @@ -948,7 +955,7 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname, /* Now move the existing entries one back. */ memmove (&l->l_scope[1], &l->l_scope[0], - 3 * sizeof (struct r_scope_elem *)); + sizeof (l->l_scope) - sizeof (l->l_scope[0])); /* Now add the new entry. */ l->l_scope[0] = &l->l_symbolic_searchlist; -- cgit v1.1