From 38fb01be3adb897ef8a1cb43e611ce7aacb0025a Mon Sep 17 00:00:00 2001 From: skrll Date: Wed, 15 Dec 2004 10:26:29 +0000 Subject: [PATCH] Apply fixes from Charles: - Fix how _rtld_relocate_nonplt_self deals with REL32 relocations. - Change the assert so that it is correct for binutils 2.14 and 2.15. There are still problems with the libraries generated with binutils 2.15, but at least ld.elf_so doesn't crash. --- libexec/ld.elf_so/arch/mips/mips_reloc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libexec/ld.elf_so/arch/mips/mips_reloc.c b/libexec/ld.elf_so/arch/mips/mips_reloc.c index fb6d4c31c272..cc02e158899b 100644 --- a/libexec/ld.elf_so/arch/mips/mips_reloc.c +++ b/libexec/ld.elf_so/arch/mips/mips_reloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mips_reloc.c,v 1.45 2003/11/19 19:41:57 simonb Exp $ */ +/* $NetBSD: mips_reloc.c,v 1.46 2004/12/15 10:26:29 skrll Exp $ */ /* * Copyright 1997 Michael L. Hitch @@ -137,13 +137,11 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase) case R_TYPE(REL32): assert(ELF_R_SYM(rel->r_info) < gotsym); sym = symtab + ELF_R_SYM(rel->r_info); - assert(sym->st_info == - ELF_ST_INFO(STB_LOCAL, STT_SECTION)); + assert(ELF_ST_BIND(sym->st_info) == STB_LOCAL); if (__predict_true(RELOC_ALIGNED_P(where))) - *where += (Elf_Addr)(sym->st_value + relocbase); + *where += relocbase; else - store_ptr(where, load_ptr(where) + - (Elf_Addr)(sym->st_value + relocbase)); + store_ptr(where, load_ptr(where) + relocbase); break; default: