OSDN Git Service

Phase one of my evil plan to clean up ld.so...
[uclinux-h8/uClibc.git] / ldso / ldso / dl-elf.c
index 0290d6c..dd3d9a2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, 
  *                             David Engel, Hongjiu Lu and Mitch D'Souza
- * Copyright (C) 2001-2002, Erik Andersen
+ * Copyright (C) 2001-2003, Erik Andersen
  *
  * All rights reserved.
  *
@@ -316,12 +316,12 @@ goof:
 struct elf_resolve *_dl_load_elf_shared_library(int secure,
        struct dyn_elf **rpnt, char *libname)
 {
-       elfhdr *epnt;
+       ElfW(Ehdr) *epnt;
        unsigned long dynamic_addr = 0;
        unsigned long dynamic_size = 0;
        Elf32_Dyn *dpnt;
        struct elf_resolve *tpnt;
-       elf_phdr *ppnt;
+       ElfW(Phdr) *ppnt;
        char *status;
        char header[4096];
        unsigned long dynamic_info[24];
@@ -371,7 +371,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
        }
 
        _dl_read(infile, header, sizeof(header));
-       epnt = (elfhdr *) (intptr_t) header;
+       epnt = (ElfW(Ehdr) *) (intptr_t) header;
        if (epnt->e_ident[0] != 0x7f ||
                epnt->e_ident[1] != 'E' || 
                epnt->e_ident[2] != 'L' || 
@@ -398,7 +398,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
                return NULL;
        };
 
-       ppnt = (elf_phdr *)(intptr_t) & header[epnt->e_phoff];
+       ppnt = (ElfW(Phdr) *)(intptr_t) & header[epnt->e_phoff];
 
        piclib = 1;
        for (i = 0; i < epnt->e_phnum; i++) {
@@ -446,7 +446,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
        flags |= MAP_FIXED;
 
        /* Get the memory to store the library */
-       ppnt = (elf_phdr *)(intptr_t) & header[epnt->e_phoff];
+       ppnt = (ElfW(Phdr) *)(intptr_t) & header[epnt->e_phoff];
 
        for (i = 0; i < epnt->e_phnum; i++) {
                if (ppnt->p_type == PT_LOAD) {
@@ -577,7 +577,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
 
        if (dynamic_info[DT_TEXTREL]) {
 #ifndef FORCE_SHAREABLE_TEXT_SEGMENTS
-               ppnt = (elf_phdr *)(intptr_t) & header[epnt->e_phoff];
+               ppnt = (ElfW(Phdr) *)(intptr_t) & header[epnt->e_phoff];
                for (i = 0; i < epnt->e_phnum; i++, ppnt++) {
                        if (ppnt->p_type == PT_LOAD && !(ppnt->p_flags & PF_W))
                                _dl_mprotect((void *) ((piclib ? libaddr : 0) + 
@@ -594,7 +594,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
        tpnt = _dl_add_elf_hash_table(libname, (char *) libaddr, dynamic_info, 
                dynamic_addr, dynamic_size);
 
-       tpnt->ppnt = (elf_phdr *)(intptr_t) (tpnt->loadaddr + epnt->e_phoff);
+       tpnt->ppnt = (ElfW(Phdr) *)(intptr_t) (tpnt->loadaddr + epnt->e_phoff);
        tpnt->n_phent = epnt->e_phnum;
 
        /*