Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so/arch/mips Simplify the GOT relocation code...



details:   https://anonhg.NetBSD.org/src/rev/0f6ab409d7ad
branches:  trunk
changeset: 536339:0f6ab409d7ad
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Fri Sep 13 16:31:28 2002 +0000

description:
Simplify the GOT relocation code somewhat.

diffstat:

 libexec/ld.elf_so/arch/mips/mips_reloc.c |  22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)

diffs (44 lines):

diff -r fdf440c94386 -r 0f6ab409d7ad libexec/ld.elf_so/arch/mips/mips_reloc.c
--- a/libexec/ld.elf_so/arch/mips/mips_reloc.c  Fri Sep 13 16:03:20 2002 +0000
+++ b/libexec/ld.elf_so/arch/mips/mips_reloc.c  Fri Sep 13 16:31:28 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mips_reloc.c,v 1.26 2002/09/13 16:03:20 mycroft Exp $  */
+/*     $NetBSD: mips_reloc.c,v 1.27 2002/09/13 16:31:28 mycroft Exp $  */
 
 /*
  * Copyright 1997 Michael L. Hitch <mhitch%montana.edu@localhost>
@@ -139,12 +139,7 @@
        sym = symtab + gotsym;
        /* Now do the global GOT entries */
        for (i = gotsym; i < symtabno; i++) {
-               if (sym->st_shndx == SHN_UNDEF ||
-                   sym->st_shndx == SHN_COMMON)
-                       *got = sym->st_value + relocbase;
-               else if (ELF_ST_TYPE(sym->st_info) == STT_FUNC)
-                       *got += relocbase;
-               else if (ELF_ST_TYPE(sym->st_info) == STT_SECTION &&
+               if (ELF_ST_TYPE(sym->st_info) == STT_SECTION &&
                    ELF_ST_BIND(sym->st_info) == STB_GLOBAL) {
                        if (sym->st_shndx == SHN_ABS)
                                *got = sym->st_value + relocbase;
@@ -254,18 +249,9 @@
                rdbg((" doing got %d sym %p (%s, %x)", i - obj->gotsym, sym,
                    sym->st_name + obj->strtab, *got));
 
-               if (sym->st_shndx == SHN_UNDEF &&
-                   ELF_ST_BIND(sym->st_info) != STB_WEAK &&
-                   ELF_ST_TYPE(sym->st_info) == STT_FUNC)
+               if (ELF_ST_TYPE(sym->st_info) == STT_FUNC &&
+                   ELF_ST_BIND(sym->st_info) != STB_WEAK)
                        *got = sym->st_value + (Elf_Addr)obj->relocbase;
-               else if (sym->st_shndx == SHN_UNDEF ||
-                   sym->st_shndx == SHN_COMMON) {
-                       def = _rtld_find_symdef(i, obj, &defobj, true);
-                       if (def == NULL)
-                               return -1;
-                       *got = def->st_value + (Elf_Addr)defobj->relocbase;
-               } else if (ELF_ST_TYPE(sym->st_info) == STT_FUNC)
-                       *got += (Elf_Addr)obj->relocbase;
                else if (ELF_ST_TYPE(sym->st_info) == STT_SECTION &&
                    ELF_ST_BIND(sym->st_info) == STB_GLOBAL) {
                        if (sym->st_shndx == SHN_ABS)



Home | Main Index | Thread Index | Old Index