OSDN Git Service

Hopefully fix the bug Oleg reported in http://uclibc.org/lists/uclibc/2005-October...
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>
Sat, 29 Oct 2005 13:46:25 +0000 (13:46 -0000)
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>
Sat, 29 Oct 2005 13:46:25 +0000 (13:46 -0000)
This will only fix powerpc. Should be easy to fix the other arches.

ldso/ldso/dl-elf.c
ldso/ldso/ldso.c
ldso/ldso/powerpc/elfinterp.c

index 28b3094..6c9a1fd 100644 (file)
@@ -631,7 +631,9 @@ int _dl_fixup(struct dyn_elf *rpnt, int now_flag)
        ElfW(Addr) reloc_addr;
 
        if (rpnt->next)
-               goof += _dl_fixup(rpnt->next, now_flag);
+               goof = _dl_fixup(rpnt->next, now_flag);
+       if (goof)
+               return goof;
        tpnt = rpnt->dyn;
 
        if(!(tpnt->init_flag & RELOCS_DONE)) 
index 3d6884c..fac66ba 100644 (file)
@@ -122,7 +122,7 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
        ElfW(Phdr) *ppnt;
        ElfW(Dyn) *dpnt;
        char *lpntstr;
-       int i, goof = 0, unlazy = 0, trace_loaded_objects = 0;
+       int i, unlazy = 0, trace_loaded_objects = 0;
        struct dyn_elf *rpnt;
        struct elf_resolve *tcurr;
        struct elf_resolve *tpnt1;
@@ -724,7 +724,8 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
         * order so that COPY directives work correctly.
         */
        if (_dl_symbol_tables)
-               goof += _dl_fixup(_dl_symbol_tables, unlazy);
+               if (_dl_fixup(_dl_symbol_tables, unlazy))
+                       _dl_exit(-1);
 
        for (tpnt = _dl_loaded_modules; tpnt; tpnt = tpnt->next) {
                if (tpnt->relro_size)
index 4ec4598..3dd12f0 100644 (file)
@@ -138,7 +138,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
        finaladdr = (Elf32_Addr) _dl_find_hash(symname,
                        tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
        if (unlikely(!finaladdr)) {
-               _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname);
+               _dl_dprintf(2, "%s: can't resolve symbol '%s' in lib '%s'.\n", _dl_progname, symname, tpnt->libname);
                _dl_exit(1);
        };
        finaladdr += this_reloc->r_addend;
@@ -379,15 +379,15 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
                {
                        int reloc_type = ELF32_R_TYPE(rpnt->r_info);
 #if defined (__SUPPORT_LD_DEBUG__)
-                       _dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type));
+                       _dl_dprintf(2, "can't handle reloc type '%s' in lib '%s'\n", _dl_reltypes(reloc_type), tpnt->libname);
 #else
-                       _dl_dprintf(2, "can't handle reloc type %x\n", reloc_type);
+                       _dl_dprintf(2, "can't handle reloc type %x in lib '%s'\n", reloc_type, tpnt->libname);
 #endif
-                       _dl_exit(-res);
+                       return res;
                }
                if (unlikely(res >0))
                {
-                       _dl_dprintf(2, "can't resolve symbol\n");
+                       _dl_dprintf(2, "can't resolve symbol in lib '%s'.\n", tpnt->libname);
                        return res;
                }
          }