diff options
author | Jan Kotas <jkotas@microsoft.com> | 2021-03-27 06:02:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-27 06:02:35 +0300 |
commit | 67983f7bd8e415e343ce4e5148208302a7049d4b (patch) | |
tree | 092635939aac82c2b05445ded7ac01067d0883c4 /src/coreclr/md | |
parent | 01d724c1bd1ba9a21a307ee10f881be26f443dd8 (diff) |
Delete unreachable code for emitting PE fixups and obj files (#50259)
* Delete unrechable code for emitting PE fixups and obj files
* Fold ICeeGen into ICeeGenInternal and change IID
Diffstat (limited to 'src/coreclr/md')
-rw-r--r-- | src/coreclr/md/ceefilegen/cceegen.cpp | 55 |
1 files changed, 3 insertions, 52 deletions
diff --git a/src/coreclr/md/ceefilegen/cceegen.cpp b/src/coreclr/md/ceefilegen/cceegen.cpp index 707d45ab83f..adddcddb206 100644 --- a/src/coreclr/md/ceefilegen/cceegen.cpp +++ b/src/coreclr/md/ceefilegen/cceegen.cpp @@ -18,7 +18,7 @@ HRESULT STDMETHODCALLTYPE CreateICeeGen(REFIID riid, void **pCeeGen) { - if (riid != IID_ICeeGen) + if (riid != IID_ICeeGenInternal) return E_NOTIMPL; if (!pCeeGen) return E_POINTER; @@ -67,9 +67,7 @@ STDMETHODIMP CCeeGen::QueryInterface(REFIID riid, void** ppv) *ppv = NULL; if (riid == IID_IUnknown) - *ppv = (IUnknown*)(ICeeGen*)this; - else if (riid == IID_ICeeGen) - *ppv = (ICeeGen*)this; + *ppv = (IUnknown*)(ICeeGenInternal*)this; else if (riid == IID_ICeeGenInternal) *ppv = (ICeeGenInternal*)this; if (*ppv == NULL) @@ -226,16 +224,6 @@ STDMETHODIMP CCeeGen::GenerateCeeFile () return E_NOTIMPL; } -STDMETHODIMP CCeeGen::GenerateCeeMemoryImage (void **) -{ - BEGIN_ENTRYPOINT_NOTHROW; - - _ASSERTE(!"E_NOTIMPL"); - END_ENTRYPOINT_NOTHROW; - - return E_NOTIMPL; -} - STDMETHODIMP CCeeGen::GetIlSection ( HCEESECTION *section) { @@ -315,18 +303,6 @@ STDMETHODIMP CCeeGen::GetSectionBlock ( return NOERROR; } -STDMETHODIMP CCeeGen::TruncateSection ( - HCEESECTION section, - ULONG len) -{ - BEGIN_ENTRYPOINT_NOTHROW; - - _ASSERTE(!"E_NOTIMPL"); - END_ENTRYPOINT_NOTHROW; - return E_NOTIMPL; -} - - CCeeGen::CCeeGen() // protected ctor { @@ -386,7 +362,6 @@ HRESULT CCeeGen::Init() // not-virtual, protected m_metaIdx = m_textIdx; // meta section is actually in .text m_ilIdx = m_textIdx; // il section is actually in .text m_corHdrIdx = -1; - m_encMode = FALSE; LExit: if (FAILED(hr)) { @@ -396,24 +371,6 @@ LExit: return hr; } -// For EnC mode, generate strings into .rdata section rather than .text section -HRESULT CCeeGen::setEnCMode() -{ - PESection *section = NULL; - HRESULT hr = m_peSectionMan->getSectionCreate(".rdata", sdExecute, §ion); - TESTANDRETURNHR(hr); - CeeSection *ceeSection = new CeeSectionString(*this, *section); - if (ceeSection == NULL) - { - return E_OUTOFMEMORY; - } - hr = addSection(ceeSection, &m_stringIdx); - if (SUCCEEDED(hr)) - m_encMode = TRUE; - return hr; -} - - HRESULT CCeeGen::cloneInstance(CCeeGen *destination) { //public, virtual _ASSERTE(destination); @@ -493,7 +450,7 @@ HRESULT CCeeGen::getSectionCreate (const char *name, DWORD flags, CeeSection **s name = ".text"; else if (strcmp(name, ".meta") == 0) name = ".text"; - else if (strcmp(name, ".rdata") == 0 && !m_encMode) + else if (strcmp(name, ".rdata") == 0) name = ".text"; for (int i=0; i<m_numSections; i++) { if (strcmp((const char *)m_sections[i]->name(), name) == 0) { @@ -549,12 +506,6 @@ HRESULT CCeeGen::emitMetaData(IMetaDataEmit *emitter, CeeSection* section, DWORD IfFailGoto((HRESULT)(metaStream->Stat(&statStg, STATFLAG_NONAME)), Exit); buffLen = statStg.cbSize.u.LowPart; - if(m_objSwitch) - { - CeeSection* pSect; - DWORD flags = IMAGE_SCN_LNK_INFO | IMAGE_SCN_LNK_REMOVE | IMAGE_SCN_ALIGN_1BYTES; // 0x00100A00 - IfFailGoto(getSectionCreate(".cormeta",flags,&pSect,&m_metaIdx), Exit); - } buffer = (BYTE *)section->getBlock(buffLen, sizeof(DWORD)); IfNullGoto(buffer, Exit); offset = getMetaSection().dataLen() - buffLen; |