Expand the comment about the R_TYPE(RELATIVE) special-case, as it's not quite

obvious from the code.  Also, just do it all the time, as an optimization.
This commit is contained in:
mycroft 2002-09-06 15:51:23 +00:00
parent e7281ceb93
commit 492895a9f9
2 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.21 2002/09/06 15:32:56 mycroft Exp $ */
/* $NetBSD: mdreloc.c,v 1.22 2002/09/06 15:51:23 mycroft Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -273,10 +273,11 @@ _rtld_relocate_nonplt_objects(obj, self, dodebug)
value = rela->r_addend;
/*
* Handle relative relocs here, because we might not
* be able to access globals yet.
* Handle relative relocs here, because we might not be able to
* access the reloc_target_{flags,bitmask}[] tables while
* relocating ourself.
*/
if (self && type == R_TYPE(RELATIVE)) {
if (type == R_TYPE(RELATIVE)) {
*where += (Elf_Addr)(obj->relocbase + value);
continue;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.16 2002/09/06 15:32:57 mycroft Exp $ */
/* $NetBSD: mdreloc.c,v 1.17 2002/09/06 15:51:24 mycroft Exp $ */
/*-
* Copyright (c) 2000 Eduardo Horvath.
@ -555,10 +555,11 @@ _rtld_relocate_nonplt_objects(obj, self, dodebug)
value = rela->r_addend;
/*
* Handle relative relocs here, because we might not
* be able to access globals yet.
* Handle relative relocs here, because we might not be able to
* access the reloc_target_{flags,bitmask}[] tables while
* relocating ourself.
*/
if (self && type == R_TYPE(RELATIVE)) {
if (type == R_TYPE(RELATIVE)) {
/* XXXX -- apparently we ignore the preexisting value */
*where = (Elf_Addr)(obj->relocbase + value);
continue;