Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Apr 2004 11:54:40 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 50206 for review
Message-ID:  <200404021954.i32JseCN085186@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=50206

Change 50206 by peter@peter_hammer on 2004/04/02 11:54:02

	cosmetic tidy up

Affected files ...

.. //depot/projects/hammer/sys/kern/link_elf_obj.c#26 edit

Differences ...

==== //depot/projects/hammer/sys/kern/link_elf_obj.c#26 (text+ko) ====

@@ -500,7 +500,7 @@
 	vm_object_reference(ef->object);
 	ef->address = (caddr_t) vm_map_min(kernel_map);
 	error = vm_map_find(kernel_map, ef->object, 0,
-	    (vm_offset_t *) &ef->address, mapsize, 1, VM_PROT_ALL, VM_PROT_ALL, 0);
+	    (vm_offset_t *) &ef->address, mapsize, TRUE, VM_PROT_ALL, VM_PROT_ALL, FALSE);
 	if (error) {
 		vm_object_deallocate(ef->object);
 		ef->object = 0;
@@ -511,6 +511,7 @@
 	vm_map_wire(kernel_map, (vm_offset_t)mapbase,
 	    (vm_offset_t)mapbase + round_page(mapsize),
 	    VM_MAP_WIRE_SYSTEM|VM_MAP_WIRE_NOHOLES);
+
 printf("final mapbase %p, final mapsize %ld\n", mapbase, mapsize);
 
 	/* Add the base address to the previously calculated/aligned offsets */
@@ -634,8 +635,6 @@
 		    (vm_offset_t) ef->address + (ef->object->size << PAGE_SHIFT));
 		vm_object_deallocate(ef->object);
 	}
-	if (ef->address)
-		free(ef->address, M_LINKER);
 	if (ef->e_shdr)
 		free(ef->e_shdr, M_LINKER);
 	if (ef->ddbsymtab)
@@ -879,30 +878,6 @@
 	return (0);
 }
 
-#if 0
-const Elf_Sym *
-elf_get_sym(linker_file_t lf, Elf_Word symidx)
-{
-	elf_file_t ef = (elf_file_t)lf;
-
-	if (symidx >= ef->nchains)
-		return (NULL);
-	return (ef->symtab + symidx);
-}
-
-const char *
-elf_get_symname(linker_file_t lf, Elf_Word symidx)
-{
-	elf_file_t ef = (elf_file_t)lf;
-	const Elf_Sym *sym;
-
-	if (symidx >= ef->nchains)
-		return (NULL);
-	sym = ef->symtab + symidx;
-	return (ef->strtab + sym->st_name);
-}
-#endif
-
 /*
  * Symbol lookup function that can be used when the symbol index is known (ie
  * in relocations). It uses the symbol index instead of doing a fully fledged
@@ -961,6 +936,11 @@
 		ret = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps));
 printf("STB_GLOBAL: sym %p idx %lx name '%s' -> 0x%lx\n", sym, symidx, symbol, ret);
 		return ret;
+
+	case STB_WEAK:
+		printf("Weak symbols not supported\n");
+		return (0);
+
 	default:
 printf("UNKNOWN BINDING %d\n", ELF64_ST_BIND(sym->st_info));
 		return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404021954.i32JseCN085186>