Use std::vector for reading object file symbols

This commit is contained in:
Rangi42
2024-02-27 11:28:12 -05:00
committed by Sylvie
parent 9a51fbafb3
commit f47ce337bf
6 changed files with 31 additions and 58 deletions

View File

@@ -6,6 +6,7 @@
#include <deque>
#include <stdint.h>
#include <vector>
#include "link/section.hpp"
@@ -15,7 +16,7 @@ struct Assertion {
struct Patch patch; // Also used for its `.type`
char *message;
// This would be redundant with `.section->fileSymbols`... but `section` is sometimes NULL!
struct Symbol **fileSymbols;
std::vector<struct Symbol *> *fileSymbols;
};
/*

View File

@@ -5,9 +5,11 @@
#define RGBDS_LINK_SDAS_OBJ_H
#include <stdio.h>
#include <vector>
struct FileStackNode;
struct Symbol;
void sdobj_ReadFile(struct FileStackNode const *fileName, FILE *file);
void sdobj_ReadFile(struct FileStackNode const *fileName, FILE *file, std::vector<struct Symbol *> &fileSymbols);
#endif // RGBDS_LINK_SDAS_OBJ_H

View File

@@ -47,7 +47,7 @@ struct Section {
uint8_t *data; // Array of size `size`
std::vector<struct Patch> *patches;
// Extra info computed during linking
struct Symbol **fileSymbols;
std::vector<struct Symbol *> *fileSymbols;
uint32_t nbSymbols;
struct Symbol **symbols;
struct Section *nextu; // The next "component" of this unionized sect