From 55b911654c59ad24258995d697f56bf1d56a96e1 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Wed, 11 Mar 2020 01:46:26 +0100 Subject: [PATCH] Get rid of obsoleted function --- include/asm/symbol.h | 1 - src/asm/symbol.c | 47 -------------------------------------------- 2 files changed, 48 deletions(-) diff --git a/include/asm/symbol.h b/include/asm/symbol.h index 407730f3..91aabbb5 100644 --- a/include/asm/symbol.h +++ b/include/asm/symbol.h @@ -111,7 +111,6 @@ void sym_ShiftCurrentMacroArgs(void); struct sSymbol *sym_AddString(char const *tzSym, char const *tzValue); uint32_t sym_GetDefinedValue(char const *s); void sym_Purge(char const *tzName); -bool sym_IsRelocDiffDefined(char const *tzSym1, char const *tzSym2); /* Functions to save and restore the current symbol scope. */ struct sSymbol *sym_GetCurrentSymbolScope(void); diff --git a/src/asm/symbol.c b/src/asm/symbol.c index ee2650f7..ab9e81bf 100644 --- a/src/asm/symbol.c +++ b/src/asm/symbol.c @@ -586,53 +586,6 @@ struct sSymbol *sym_AddReloc(char const *tzSym) return pScope; } -/* - * Check if the subtraction of two symbols is defined. That is, either both - * symbols are defined and the result is a constant, or both symbols are - * relocatable and belong to the same section. - * - * It returns 1 if the difference is defined, 0 if not. - */ -bool sym_IsRelocDiffDefined(char const *tzSym1, char const *tzSym2) -{ - const struct sSymbol *nsym1 = sym_FindSymbol(tzSym1); - const struct sSymbol *nsym2 = sym_FindSymbol(tzSym2); - - /* Do the symbols exist? */ - if (nsym1 == NULL) - fatalerror("Symbol \"%s\" isn't defined.", tzSym1); - - if (nsym2 == NULL) - fatalerror("Symbol \"%s\" isn't defined.", tzSym2); - - int32_t s1const = sym_IsConstant(nsym1); - int32_t s2const = sym_IsConstant(nsym2); - - /* Both are non-relocatable */ - if (s1const && s2const) - return true; - - /* One of them is relocatable, the other one is not. */ - if (s1const ^ s2const) - return false; - - /* - * Both of them are relocatable. Make sure they are defined (internal - * coherency with sym_AddReloc and sym_AddLocalReloc). - */ - if (!sym_IsDefined(nsym1)) - fatalerror("Label \"%s\" isn't defined.", tzSym1); - - if (!sym_IsDefined(nsym2)) - fatalerror("Label \"%s\" isn't defined.", tzSym2); - - /* - * Both of them must be in the same section for the difference to be - * defined. - */ - return nsym1->pSection == nsym2->pSection; -} - /* * Export a symbol */