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 The sense of the SHN_ABS test ha...
details: https://anonhg.NetBSD.org/src/rev/f31ce76f9067
branches: trunk
changeset: 536346:f31ce76f9067
user: mycroft <mycroft%NetBSD.org@localhost>
date: Fri Sep 13 17:36:00 2002 +0000
description:
The sense of the SHN_ABS test has always been reversed. Fortunately nobody
ever tried to reference stuff like _DYNAMIC_LINK and _gp_disp in C code...
diffstat:
libexec/ld.elf_so/arch/mips/mips_reloc.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 95dd0bfc6f02 -r f31ce76f9067 libexec/ld.elf_so/arch/mips/mips_reloc.c
--- a/libexec/ld.elf_so/arch/mips/mips_reloc.c Fri Sep 13 17:29:56 2002 +0000
+++ b/libexec/ld.elf_so/arch/mips/mips_reloc.c Fri Sep 13 17:36:00 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mips_reloc.c,v 1.29 2002/09/13 17:07:12 mycroft Exp $ */
+/* $NetBSD: mips_reloc.c,v 1.30 2002/09/13 17:36:00 mycroft Exp $ */
/*
* Copyright 1997 Michael L. Hitch <mhitch%montana.edu@localhost>
@@ -245,13 +245,16 @@
if (ELF_ST_TYPE(sym->st_info) == STT_FUNC &&
sym->st_value != 0)
+ /* The symbol table contains the address of the PLT
+ slot. However, sometimes a PLT slot is not
+ allocated, so we have to check st_value first. */
*got = sym->st_value + (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)
+ /* Symbols with index SHN_ABS are not relocated. */
+ if (sym->st_shndx != SHN_ABS)
*got = sym->st_value +
(Elf_Addr)obj->relocbase;
- /* else SGI stuff ignored */
} else {
def = _rtld_find_symdef(i, obj, &defobj, true);
if (def == NULL)
Home |
Main Index |
Thread Index |
Old Index