1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Use incremental link for z_message/z_game_over data shenanigans (#2051)

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
cadmic 2024-08-19 09:16:04 -07:00 committed by GitHub
parent 46a5fa919b
commit f5fd8daffb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 56 additions and 74 deletions

View file

@ -136,8 +136,6 @@ static const char *const stmtNames[] =
[STMT_entry] = "entry",
[STMT_flags] = "flags",
[STMT_include] = "include",
[STMT_include_data_only_within_rodata] = "include_data_only_within_rodata",
[STMT_include_no_data] = "include_no_data",
[STMT_name] = "name",
[STMT_number] = "number",
[STMT_romalign] = "romalign",
@ -159,8 +157,7 @@ STMTId get_stmt_id_by_stmt_name(const char *stmtName, int lineNum) {
bool parse_segment_statement(struct Segment *currSeg, STMTId stmt, char* args, int lineNum) {
// ensure no duplicates (except for 'include' or 'pad_text')
if (stmt != STMT_include && stmt != STMT_include_data_only_within_rodata &&
stmt != STMT_include_no_data && stmt != STMT_pad_text &&
if (stmt != STMT_include && stmt != STMT_pad_text &&
(currSeg->fields & (1 << stmt)))
util_fatal_error("line %i: duplicate '%s' statement", lineNum, stmtNames[stmt]);
@ -213,8 +210,6 @@ bool parse_segment_statement(struct Segment *currSeg, STMTId stmt, char* args, i
util_fatal_error("line %i: alignment is not a power of two", lineNum);
break;
case STMT_include:
case STMT_include_data_only_within_rodata:
case STMT_include_no_data:
currSeg->includesCount++;
currSeg->includes = realloc(currSeg->includes, currSeg->includesCount * sizeof(*currSeg->includes));
@ -222,8 +217,6 @@ bool parse_segment_statement(struct Segment *currSeg, STMTId stmt, char* args, i
util_fatal_error("line %i: invalid filename", lineNum);
currSeg->includes[currSeg->includesCount - 1].linkerPadding = 0;
currSeg->includes[currSeg->includesCount - 1].dataOnlyWithinRodata = (stmt == STMT_include_data_only_within_rodata);
currSeg->includes[currSeg->includesCount - 1].noData = (stmt == STMT_include_no_data);
break;
case STMT_increment:
if (!parse_number(args, &currSeg->increment))