From 4bfc6fe21c13596ef3136a9322a9d4efe21b246f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 26 Feb 1998 12:44:42 +0000 Subject: [PATCH] (elf_machine_rela): Simplify bootstrapping. Produce saner error messages. --- sysdeps/alpha/dl-machine.h | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index e429e51426b..4746527820f 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -379,35 +379,24 @@ elf_machine_rela (struct link_map *map, sym_value = sym ? loadbase + sym->st_value : 0; sym_value += reloc->r_addend; - if (r_info == R_ALPHA_GLOB_DAT) + if (r_info == R_ALPHA_GLOB_DAT || r_info == R_ALPHA_REFQUAD) *reloc_addr = sym_value; else if (r_info == R_ALPHA_JMP_SLOT) { *reloc_addr = sym_value; elf_alpha_fix_plt (map, reloc, (Elf64_Addr) reloc_addr, sym_value); } - else if (r_info == R_ALPHA_REFQUAD) - { - sym_value += *reloc_addr; -#ifndef RTLD_BOOTSTRAP - if (map == &_dl_rtld_map) - { - /* Undo the relocation done here during bootstrapping. - Now we will relocate anew, possibly using a binding - found in the user program or a loaded library rather - than the dynamic linker's built-in definitions used - while loading those libraries. */ - const Elf64_Sym *const dlsymtab - = (void *)(map->l_addr + map->l_info[DT_SYMTAB]->d_un.d_ptr); - sym_value -= map->l_addr; - sym_value -= dlsymtab[ELF64_R_SYM(reloc->r_info)].st_value; - sym_value -= reloc->r_addend; - } + else +#ifdef RTLD_BOOTSTRAP + /* There is no point calling _dl_sysdep_error, it + almost certainly hasn't been relocated properly. */ + asm ("halt"); +#else + extern char **_dl_argv; + _dl_sysdep_error (_dl_argv[0] ?: "", + ": Unknown relocation type\n", NULL); #endif - *reloc_addr = sym_value; } - else - assert (! "unexpected dynamic reloc type"); } } -- 2.47.2