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 Expand the comment about the R_TYPE(R...



details:   https://anonhg.NetBSD.org/src/rev/6b6dd51f73c0
branches:  trunk
changeset: 536098:6b6dd51f73c0
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Fri Sep 06 15:51:23 2002 +0000

description:
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.

diffstat:

 libexec/ld.elf_so/arch/sparc/mdreloc.c   |  9 +++++----
 libexec/ld.elf_so/arch/sparc64/mdreloc.c |  9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diffs (48 lines):

diff -r 5b8dc580b7e2 -r 6b6dd51f73c0 libexec/ld.elf_so/arch/sparc/mdreloc.c
--- a/libexec/ld.elf_so/arch/sparc/mdreloc.c    Fri Sep 06 15:48:51 2002 +0000
+++ b/libexec/ld.elf_so/arch/sparc/mdreloc.c    Fri Sep 06 15:51:23 2002 +0000
@@ -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 @@
                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;
                }
diff -r 5b8dc580b7e2 -r 6b6dd51f73c0 libexec/ld.elf_so/arch/sparc64/mdreloc.c
--- a/libexec/ld.elf_so/arch/sparc64/mdreloc.c  Fri Sep 06 15:48:51 2002 +0000
+++ b/libexec/ld.elf_so/arch/sparc64/mdreloc.c  Fri Sep 06 15:51:23 2002 +0000
@@ -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 @@
                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;



Home | Main Index | Thread Index | Old Index