aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index eeda181..da0dfe9 100644
--- a/main.c
+++ b/main.c
@@ -918,6 +918,10 @@ addtosymtab(Symbol *sym)
sym->idx = symtab->hdr.sh_size / symtab->hdr.sh_entsize;
+ if (!sym->section) {
+ sym->bind = STB_GLOBAL;
+ }
+
elfsym.st_name = elfstr(strtab, sym->name);
elfsym.st_value = sym->value.c;
elfsym.st_size = sym->size;
@@ -1163,4 +1167,4 @@ main(int argc, char *argv[])
handlerelocs();
outelf();
return 0;
-} \ No newline at end of file
+}