load_elf.c (163765) | load_elf.c (163914) |
---|---|
1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3 * Copyright (c) 1998 Peter Wemm <peter@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3 * Copyright (c) 1998 Peter Wemm <peter@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/boot/common/load_elf.c 163765 2006-10-29 14:50:58Z ru $"); | 29__FBSDID("$FreeBSD: head/sys/boot/common/load_elf.c 163914 2006-11-02 17:28:38Z ru $"); |
30 31#include <sys/param.h> 32#include <sys/exec.h> 33#include <sys/linker.h> 34#include <sys/module.h> 35#include <string.h> 36#include <machine/elf.h> 37#include <stand.h> --- 220 unchanged lines hidden (view full) --- 258 ret = 0; 259 firstaddr = lastaddr = 0; 260 ehdr = ef->ehdr; 261 if (ef->kernel) { 262#ifdef __i386__ 263#if __ELF_WORD_SIZE == 64 264 off = - (off & 0xffffffffff000000ull);/* x86_64 relocates after locore */ 265#else | 30 31#include <sys/param.h> 32#include <sys/exec.h> 33#include <sys/linker.h> 34#include <sys/module.h> 35#include <string.h> 36#include <machine/elf.h> 37#include <stand.h> --- 220 unchanged lines hidden (view full) --- 258 ret = 0; 259 firstaddr = lastaddr = 0; 260 ehdr = ef->ehdr; 261 if (ef->kernel) { 262#ifdef __i386__ 263#if __ELF_WORD_SIZE == 64 264 off = - (off & 0xffffffffff000000ull);/* x86_64 relocates after locore */ 265#else |
266 off = - (off & 0xc0000000u); /* i386 relocates after locore */ | 266 off = - (off & 0xff000000u); /* i386 relocates after locore */ |
267#endif 268#else 269 off = 0; /* other archs use direct mapped kernels */ 270#endif 271 } 272 ef->off = off; 273 274 if ((ehdr->e_phoff + ehdr->e_phnum * sizeof(*phdr)) > ef->firstlen) { --- 478 unchanged lines hidden --- | 267#endif 268#else 269 off = 0; /* other archs use direct mapped kernels */ 270#endif 271 } 272 ef->off = off; 273 274 if ((ehdr->e_phoff + ehdr->e_phnum * sizeof(*phdr)) > ef->firstlen) { --- 478 unchanged lines hidden --- |