object_file.cc (13982:175e05a8ee6a) object_file.cc (14017:815c925b777d)
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;

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

68 if (fileData) {
69 ::munmap((char*)fileData, len);
70 fileData = NULL;
71 }
72}
73
74
75bool
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;

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

68 if (fileData) {
69 ::munmap((char*)fileData, len);
70 fileData = NULL;
71 }
72}
73
74
75bool
76ObjectFile::loadSection(Section *sec, PortProxy& mem_proxy, Addr addr_mask,
77 Addr offset)
76ObjectFile::loadSection(Section *sec, const PortProxy& mem_proxy,
77 Addr addr_mask, Addr offset)
78{
79 if (sec->size != 0) {
80 Addr addr = (sec->baseAddr & addr_mask) + offset;
81 if (sec->fileImage) {
82 mem_proxy.writeBlob(addr, sec->fileImage, sec->size);
83 }
84 else {
85 // no image: must be bss
86 mem_proxy.memsetBlob(addr, 0, sec->size);
87 }
88 }
89 return true;
90}
91
92
93bool
78{
79 if (sec->size != 0) {
80 Addr addr = (sec->baseAddr & addr_mask) + offset;
81 if (sec->fileImage) {
82 mem_proxy.writeBlob(addr, sec->fileImage, sec->size);
83 }
84 else {
85 // no image: must be bss
86 mem_proxy.memsetBlob(addr, 0, sec->size);
87 }
88 }
89 return true;
90}
91
92
93bool
94ObjectFile::loadSections(PortProxy& mem_proxy, Addr addr_mask, Addr offset)
94ObjectFile::loadSections(const PortProxy& mem_proxy, Addr addr_mask,
95 Addr offset)
95{
96 return (loadSection(&text, mem_proxy, addr_mask, offset)
97 && loadSection(&data, mem_proxy, addr_mask, offset)
98 && loadSection(&bss, mem_proxy, addr_mask, offset));
99}
100
101namespace
102{

--- 143 unchanged lines hidden ---
96{
97 return (loadSection(&text, mem_proxy, addr_mask, offset)
98 && loadSection(&data, mem_proxy, addr_mask, offset)
99 && loadSection(&bss, mem_proxy, addr_mask, offset));
100}
101
102namespace
103{

--- 143 unchanged lines hidden ---