From: Gabe Black Date: Sun, 29 Sep 2019 02:07:17 +0000 (-0700) Subject: base: Get rid of the unused global pointer in object files. X-Git-Tag: v19.0.0.0~468 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93595f4a2a069d1b10c6ff63a5f5273b3a695549;p=gem5.git base: Get rid of the unused global pointer in object files. This was only ever read from Alpha, and nothing ever set it. It defaulted to zero, so this change just propogates that value through to the Alpha Process class. Change-Id: I569cf9d61a37322dbd88de1038a2af74c64bbe7a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21461 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc index 83c4c2619..ea1cb0819 100644 --- a/src/arch/alpha/process.cc +++ b/src/arch/alpha/process.cc @@ -213,7 +213,7 @@ AlphaProcess::initState() argsInit(MachineBytes, PageBytes); ThreadContext *tc = system->getThreadContext(contextIds[0]); - tc->setIntReg(GlobalPointerReg, objFile->globalPointer()); + tc->setIntReg(GlobalPointerReg, 0); //Operate in user mode tc->setMiscRegNoEffect(IPR_ICM, mode_user << 3); tc->setMiscRegNoEffect(IPR_DTB_CM, mode_user << 3); diff --git a/src/base/loader/object_file.cc b/src/base/loader/object_file.cc index ede8922e9..0bb897cee 100644 --- a/src/base/loader/object_file.cc +++ b/src/base/loader/object_file.cc @@ -57,7 +57,7 @@ ObjectFile::ObjectFile(const string &_filename, size_t _len, uint8_t *_data, Arch _arch, OpSys _op_sys) : filename(_filename), fileData(_data), len(_len), - arch(_arch), opSys(_op_sys), entry(0), globalPtr(0), + arch(_arch), opSys(_op_sys), entry(0), text{0, nullptr, 0}, data{0, nullptr, 0}, bss{0, nullptr, 0} { } diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh index bd9d6260a..14dee3be0 100644 --- a/src/base/loader/object_file.hh +++ b/src/base/loader/object_file.hh @@ -123,7 +123,6 @@ class ObjectFile }; Addr entry; - Addr globalPtr; Section text; Section data; @@ -131,13 +130,10 @@ class ObjectFile bool loadSection(Section *sec, const PortProxy& mem_proxy, Addr mask, Addr offset = 0); - void setGlobalPointer(Addr global_ptr) { globalPtr = global_ptr; } public: Addr entryPoint() const { return entry; } - Addr globalPointer() const { return globalPtr; } - Addr textBase() const { return text.baseAddr; } Addr dataBase() const { return data.baseAddr; } Addr bssBase() const { return bss.baseAddr; }