mirror of
https://github.com/autc04/Retro68.git
synced 2026-04-22 00:17:31 +00:00
fix data-to-code references for single-segment apps and code resources
This commit is contained in:
+3
-3
@@ -133,11 +133,11 @@ void Object::FlatCode(std::ostream& out)
|
||||
{
|
||||
for(auto sec : codeSections)
|
||||
{
|
||||
sec->FixRelocs();
|
||||
sec->FixRelocs(true);
|
||||
out << sec->GetData();
|
||||
}
|
||||
|
||||
dataSection->FixRelocs();
|
||||
dataSection->FixRelocs(true);
|
||||
out << dataSection->GetData();
|
||||
|
||||
std::vector<RuntimeReloc> relocs;
|
||||
@@ -338,7 +338,7 @@ void Object::MultiSegmentApp(string output, SegmentMap& segmentMap)
|
||||
|
||||
for(auto namedSec : sections)
|
||||
{
|
||||
namedSec.second->FixRelocs();
|
||||
namedSec.second->FixRelocs(false);
|
||||
}
|
||||
|
||||
for(auto sec : codeSections)
|
||||
|
||||
+2
-2
@@ -150,7 +150,7 @@ void Section::ScanRelocs()
|
||||
}
|
||||
}
|
||||
|
||||
void Section::FixRelocs()
|
||||
void Section::FixRelocs(bool allowDirectCodeRefs)
|
||||
{
|
||||
for(Reloc& rela : relocs)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ void Section::FixRelocs()
|
||||
assert(sym.section.get() == this);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(!allowDirectCodeRefs)
|
||||
{
|
||||
if(sym.section.get() != this)
|
||||
{
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ public:
|
||||
std::vector<RuntimeReloc> GetRelocations(bool useOffsets);
|
||||
|
||||
void ScanRelocs();
|
||||
void FixRelocs();
|
||||
void FixRelocs(bool allowDirectCodeRefs);
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user