Date: Sun, 17 Oct 2010 12:05:37 +0000 (UTC) From: Marius Strobl <marius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r213954 - stable/8/sys/sparc64/sparc64 Message-ID: <201010171205.o9HC5bP9029120@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marius Date: Sun Oct 17 12:05:37 2010 New Revision: 213954 URL: http://svn.freebsd.org/changeset/base/213954 Log: MFC: r213104 minor simplifications and cosmetics Modified: stable/8/sys/sparc64/sparc64/elf_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/elf_machdep.c Sun Oct 17 11:51:59 2010 (r213953) +++ stable/8/sys/sparc64/sparc64/elf_machdep.c Sun Oct 17 12:05:37 2010 (r213954) @@ -128,8 +128,8 @@ void elf64_dump_thread(struct thread *td __unused, void *dst __unused, size_t *off __unused) { -} +} /* * The following table holds for each relocation type: @@ -215,7 +215,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", @@ -271,10 +271,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) @@ -284,10 +283,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 = elf_relocaddr(lf, value); + where = (Elf_Addr *)(relocbase + rela->r_offset); + *where = elf_relocaddr(lf, rela->r_addend + relocbase); return (0); } @@ -342,9 +339,8 @@ elf_reloc(linker_file_t lf, Elf_Addr rel if (RELOC_PC_RELATIVE(rtype)) value -= (Elf_Addr)where; - if (RELOC_BASE_RELATIVE(rtype)) { + if (RELOC_BASE_RELATIVE(rtype)) value = elf_relocaddr(lf, value + relocbase); - } mask = RELOC_VALUE_BITMASK(rtype); value >>= RELOC_VALUE_RIGHTSHIFT(rtype);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010171205.o9HC5bP9029120>