mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-26 22:51:01 +00:00
fix data-to-code references for single-segment apps and code resources
This commit is contained in:
parent
88d7614612
commit
1bf9012d5e
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
std::vector<RuntimeReloc> GetRelocations(bool useOffsets);
|
||||
|
||||
void ScanRelocs();
|
||||
void FixRelocs();
|
||||
void FixRelocs(bool allowDirectCodeRefs);
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user