svn commit: r213955 - stable/7/sys/sparc64/sparc64

Marius Strobl marius at FreeBSD.org
Sun Oct 17 12:05:40 UTC 2010


Author: marius
Date: Sun Oct 17 12:05:39 2010
New Revision: 213955
URL: http://svn.freebsd.org/changeset/base/213955

Log:
  MFC: r213104
  
  minor simplifications and cosmetics

Modified:
  stable/7/sys/sparc64/sparc64/elf_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/sparc64/elf_machdep.c
==============================================================================
--- stable/7/sys/sparc64/sparc64/elf_machdep.c	Sun Oct 17 12:05:37 2010	(r213954)
+++ stable/7/sys/sparc64/sparc64/elf_machdep.c	Sun Oct 17 12:05:39 2010	(r213955)
@@ -127,8 +127,8 @@ void
 elf64_dump_thread(struct thread *td __unused, void *dst __unused,
     size_t *off __unused)
 {
-}
 
+}
 
 /*
  * The following table holds for each relocation type:
@@ -213,7 +213,7 @@ static const int reloc_target_flags[] = 
 };
 
 #if 0
-static const char *reloc_names[] = {
+static const char *const reloc_names[] = {
 	"NONE", "RELOC_8", "RELOC_16", "RELOC_32", "DISP_8",
 	"DISP_16", "DISP_32", "WDISP_30", "WDISP_22", "HI22",
 	"22", "13", "LO10", "GOT10", "GOT13",
@@ -268,10 +268,9 @@ static const long reloc_target_bitmask[]
 
 int
 elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, const void *data,
-    int type, elf_lookup_fn lookup)
+    int type, elf_lookup_fn lookup __unused)
 {
 	const Elf_Rela *rela;
-	Elf_Addr value;
 	Elf_Addr *where;
 
 	if (type != ELF_RELOC_RELA)
@@ -281,10 +280,8 @@ elf_reloc_local(linker_file_t lf, Elf_Ad
 	if (ELF64_R_TYPE_ID(rela->r_info) != R_SPARC_RELATIVE)
 		return (-1);
 
-	value = rela->r_addend + (Elf_Addr)lf->address;
-	where = (Elf_Addr *)((Elf_Addr)lf->address + rela->r_offset);
-
-	*where = value;
+	where = (Elf_Addr *)(relocbase + rela->r_offset);
+	*where = rela->r_addend + relocbase;
 
 	return (0);
 }


More information about the svn-src-stable-7 mailing list