Deleted Added
sdiff udiff text old ( 11793:ef606668d247 ) new ( 13982:175e05a8ee6a )
full compact
1/*
2 * Copyright (c) 2002-2004 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 26 unchanged lines hidden (view full) ---

35#include <sys/mman.h>
36#include <sys/types.h>
37#include <unistd.h>
38#include <zlib.h>
39
40#include <cstdio>
41#include <list>
42#include <string>
43
44#include "base/cprintf.hh"
45#include "base/loader/aout_object.hh"
46#include "base/loader/dtb_object.hh"
47#include "base/loader/ecoff_object.hh"
48#include "base/loader/elf_object.hh"
49#include "base/loader/raw_object.hh"
50#include "base/loader/symtab.hh"

--- 41 unchanged lines hidden (view full) ---

92bool
93ObjectFile::loadSections(PortProxy& mem_proxy, Addr addr_mask, Addr offset)
94{
95 return (loadSection(&text, mem_proxy, addr_mask, offset)
96 && loadSection(&data, mem_proxy, addr_mask, offset)
97 && loadSection(&bss, mem_proxy, addr_mask, offset));
98}
99
100static bool
101hasGzipMagic(int fd)
102{
103 uint8_t buf[2] = {0};
104 size_t sz = pread(fd, buf, 2, 0);
105 panic_if(sz != 2, "Couldn't read magic bytes from object file");
106 return ((buf[0] == 0x1f) && (buf[1] == 0x8b));
107}

--- 106 unchanged lines hidden ---