diff options
author | Gabe Black <gabeblack@google.com> | 2019-10-01 21:15:06 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-10-12 04:10:59 +0000 |
commit | 6ee86bf497ea87a585fe8e4651760e71244fa2fb (patch) | |
tree | b2038b4d87285261ce57d29e82ad9e67baf99676 /src/arch/alpha | |
parent | 211869ea950f3cc3116655f06b1d46d3fa39fb3a (diff) | |
download | gem5-6ee86bf497ea87a585fe8e4651760e71244fa2fb.tar.xz |
arch,base: Separate the idea of a memory image and object file.
A memory image can be described by an object file, but an object file
is more than a memory image. Also, it makes sense to manipulate a
memory image to, for instance, change how it's loaded into memory. That
takes on larger implications (relocations, the entry point, symbols,
etc.) when talking about the whole object file, and also modifies
aspects which may not need to change. For instance if an image needs
to be loaded into memory at addresses different from what's in the
object file, but other things like symbols need to stay unmodified.
Change-Id: Ia360405ffb2c1c48e0cc201ac0a0764357996a54
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21466
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/arch/alpha')
-rw-r--r-- | src/arch/alpha/process.cc | 11 | ||||
-rw-r--r-- | src/arch/alpha/system.cc | 6 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc index e266b92b2..9311a6415 100644 --- a/src/arch/alpha/process.cc +++ b/src/arch/alpha/process.cc @@ -54,10 +54,10 @@ AlphaProcess::AlphaProcess(ProcessParams *params, ObjectFile *objFile) objFile) { fatal_if(params->useArchPT, "Arch page tables not implemented."); - Addr brk_point = roundUp(objFile->maxSegmentAddr(), PageBytes); + Addr brk_point = roundUp(image.maxAddr(), PageBytes); // Set up stack. On Alpha, stack goes below the image. - Addr stack_base = objFile->minSegmentAddr() - (409600 + 4096); + Addr stack_base = image.minAddr() - (409600 + 4096); // Set up region for mmaps. Addr mmap_end = 0x10000; @@ -74,13 +74,6 @@ AlphaProcess::AlphaProcess(ProcessParams *params, ObjectFile *objFile) void AlphaProcess::argsInit(int intSize, int pageSize) { - // Patch the ld_bias for dynamic executables. - updateBias(); - - objFile->loadSegments(initVirtMem); - if (objFile->getInterpreter()) - objFile->getInterpreter()->loadSegments(initVirtMem); - std::vector<AuxVector<uint64_t>> auxv; ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile); diff --git a/src/arch/alpha/system.cc b/src/arch/alpha/system.cc index 31e7aa062..a7a47036a 100644 --- a/src/arch/alpha/system.cc +++ b/src/arch/alpha/system.cc @@ -57,13 +57,11 @@ AlphaSystem::AlphaSystem(Params *p) */ // Load Console Code console = createObjectFile(params()->console); - console->setLoadMask(loadAddrMask); if (console == NULL) fatal("Could not load console file %s", params()->console); // Load pal file pal = createObjectFile(params()->pal); - pal->setLoadMask(loadAddrMask); if (pal == NULL) fatal("Could not load PALcode file %s", params()->pal); @@ -111,8 +109,8 @@ AlphaSystem::initState() System::initState(); // Load program sections into memory - pal->loadSegments(physProxy); - console->loadSegments(physProxy); + pal->buildImage().mask(loadAddrMask).write(physProxy); + console->buildImage().mask(loadAddrMask).write(physProxy); /** * Copy the osflags (kernel arguments) into the consoles |