summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChang S. Bae <changseok.bae@gmail.com>2018-10-08 18:49:49 -0700
committerCyrill Gorcunov <gorcunov@gmail.com>2018-10-09 10:22:40 +0300
commitbffd2b7deffd9060159cd816db561ed2f89baf06 (patch)
tree0eba02c0512579058a69deb332fd13079e9c519c
parent0bdd7f15463529f22d2bf00a3af6514019e8417a (diff)
downloadnasm-bffd2b7deffd9060159cd816db561ed2f89baf06.tar.gz
macho/sym: Record initial symbol number always
The special segment may need this information for future fix-ups. Based-on-code-from: zenith432 <zenith432@users.sourceforge.net> Signed-off-by: Chang S. Bae <changseok.bae@gmail.com>
-rw-r--r--output/outmacho.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/output/outmacho.c b/output/outmacho.c
index cb566f0d..9fa12988 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -1123,6 +1123,9 @@ static void macho_symdef(char *name, int32_t section, int64_t offset,
special_used = true;
}
+ /* track the initially allocated symbol number for use in future fix-ups */
+ sym->initial_snum = nsyms;
+
if (section == NO_SEG) {
/* symbols in no section get absolute */
sym->type |= N_ABS;
@@ -1137,9 +1140,6 @@ static void macho_symdef(char *name, int32_t section, int64_t offset,
/* get the in-file index of the section the symbol was defined in */
sym->sect = s ? s->fileindex : NO_SECT;
- /* track the initially allocated symbol number for use in future fix-ups */
- sym->initial_snum = nsyms;
-
if (!s) {
/* remember symbol number of references to external
** symbols, this works because every external symbol gets