We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edc9e07 commit 95f95f8Copy full SHA for 95f95f8
src/asm/output.cpp
@@ -66,8 +66,12 @@ static uint32_t getSectIDIfAny(Section *sect) {
66
if (!sect)
67
return UINT32_MAX;
68
69
- if (auto search = sectionMap.find(sect->name); search != sectionMap.end())
70
- return static_cast<uint32_t>(search->second);
+ // Search in `sectionList` instead of `sectionMap`, since section fragments share the
+ // same name but have different IDs
71
+ if (auto search =
72
+ std::find_if(RANGE(sectionList), [§](Section const &s) { return &s == sect; });
73
+ search != sectionList.end())
74
+ return static_cast<uint32_t>(std::distance(sectionList.begin(), search));
75
76
fatalerror("Unknown section '%s'\n", sect->name.c_str());
77
}
0 commit comments