mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
.sym file sorts symbols from zero-length sections first
This will, for instance, ensure that a zero-length `SECTION "NULL", ROM0[0] / NULL::` comes first.
This commit is contained in:
@@ -302,11 +302,11 @@ static void writeSymBank(struct SortedSections const *bankSections,
|
|||||||
|
|
||||||
uint32_t nbSymbols = 0;
|
uint32_t nbSymbols = 0;
|
||||||
|
|
||||||
for (struct SortedSection const *ptr = bankSections->sections; ptr; ptr = ptr->next) {
|
for (struct SortedSection const *ptr = bankSections->zeroLenSections; ptr; ptr = ptr->next) {
|
||||||
for (struct Section const *sect = ptr->section; sect; sect = sect->nextu)
|
for (struct Section const *sect = ptr->section; sect; sect = sect->nextu)
|
||||||
nbSymbols += sect->nbSymbols;
|
nbSymbols += sect->nbSymbols;
|
||||||
}
|
}
|
||||||
for (struct SortedSection const *ptr = bankSections->zeroLenSections; ptr; ptr = ptr->next) {
|
for (struct SortedSection const *ptr = bankSections->sections; ptr; ptr = ptr->next) {
|
||||||
for (struct Section const *sect = ptr->section; sect; sect = sect->nextu)
|
for (struct Section const *sect = ptr->section; sect; sect = sect->nextu)
|
||||||
nbSymbols += sect->nbSymbols;
|
nbSymbols += sect->nbSymbols;
|
||||||
}
|
}
|
||||||
@@ -321,7 +321,7 @@ static void writeSymBank(struct SortedSections const *bankSections,
|
|||||||
|
|
||||||
uint32_t idx = 0;
|
uint32_t idx = 0;
|
||||||
|
|
||||||
for (struct SortedSection const *ptr = bankSections->sections; ptr; ptr = ptr->next) {
|
for (struct SortedSection const *ptr = bankSections->zeroLenSections; ptr; ptr = ptr->next) {
|
||||||
for (struct Section const *sect = ptr->section; sect; sect = sect->nextu) {
|
for (struct Section const *sect = ptr->section; sect; sect = sect->nextu) {
|
||||||
for (uint32_t i = 0; i < sect->nbSymbols; i++) {
|
for (uint32_t i = 0; i < sect->nbSymbols; i++) {
|
||||||
symList[idx].idx = idx;
|
symList[idx].idx = idx;
|
||||||
@@ -331,7 +331,7 @@ static void writeSymBank(struct SortedSections const *bankSections,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (struct SortedSection const *ptr = bankSections->zeroLenSections; ptr; ptr = ptr->next) {
|
for (struct SortedSection const *ptr = bankSections->sections; ptr; ptr = ptr->next) {
|
||||||
for (struct Section const *sect = ptr->section; sect; sect = sect->nextu) {
|
for (struct Section const *sect = ptr->section; sect; sect = sect->nextu) {
|
||||||
for (uint32_t i = 0; i < sect->nbSymbols; i++) {
|
for (uint32_t i = 0; i < sect->nbSymbols; i++) {
|
||||||
symList[idx].idx = idx;
|
symList[idx].idx = idx;
|
||||||
|
|||||||
Reference in New Issue
Block a user