mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-28 05:47:48 +00:00
Don't output sections in reverse order (#1613)
This commit is contained in:
@@ -67,7 +67,7 @@ static uint32_t getSectIDIfAny(Section *sect) {
|
||||
return UINT32_MAX;
|
||||
|
||||
if (auto search = sectionMap.find(sect->name); search != sectionMap.end())
|
||||
return static_cast<uint32_t>(sectionMap.size() - search->second - 1);
|
||||
return static_cast<uint32_t>(search->second);
|
||||
|
||||
fatalerror("Unknown section '%s'\n", sect->name.c_str());
|
||||
}
|
||||
@@ -347,8 +347,8 @@ void out_WriteObject() {
|
||||
for (Symbol const *sym : objectSymbols)
|
||||
writeSymbol(*sym, file);
|
||||
|
||||
for (auto it = sectionList.rbegin(); it != sectionList.rend(); it++)
|
||||
writeSection(*it, file);
|
||||
for (Section const § : sectionList)
|
||||
writeSection(sect, file);
|
||||
|
||||
putLong(assertions.size(), file);
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ std::vector<std::unique_ptr<Section>> sectionList;
|
||||
std::unordered_map<std::string, size_t> sectionMap; // Indexes into `sectionList`
|
||||
|
||||
void sect_ForEach(void (*callback)(Section &)) {
|
||||
for (auto it = sectionList.rbegin(); it != sectionList.rend(); it++)
|
||||
callback(*it->get());
|
||||
for (auto &ptr : sectionList)
|
||||
callback(*ptr);
|
||||
}
|
||||
|
||||
static void checkAgainstFixedAddress(Section const &target, Section const &other, uint16_t org) {
|
||||
|
||||
Reference in New Issue
Block a user