diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-01-02 23:00:43 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-01-02 23:00:43 +0300 |
commit | 3b4c769d998445727a6b8e77c949ae469c43281e (patch) | |
tree | 29b4390651e1a7450f8946636339172a8747aef7 /output/outelf64.c | |
parent | 3e73cfc8b77c39a61f3a393aa4e65d1da83d6d4d (diff) | |
download | nasm-3b4c769d998445727a6b8e77c949ae469c43281e.tar.gz nasm-3b4c769d998445727a6b8e77c949ae469c43281e.tar.bz2 nasm-3b4c769d998445727a6b8e77c949ae469c43281e.zip |
Elf: Allow symbols binding to undefined section
Commit 2ddcd03900d134772e98acf8cab17a12cc0c3f2a
did bind symbols (in case of omitted SECTION directive)
to .text section but break COMMON binding.
Fix it.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output/outelf64.c')
-rw-r--r-- | output/outelf64.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/output/outelf64.c b/output/outelf64.c index 18508fb..1fcd0b3 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -530,17 +530,15 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, if (segment == def_seg) { /* we have to be sure at least text section is there */ int tempint; - elf_section_names(".text", 2, &tempint); + if (segment != elf_section_names(".text", 2, &tempint)) + nasm_error(ERR_PANIC, "strange segment conditions in ELF driver"); } - sym->section = nsects; for (i = 0; i < nsects; i++) { if (segment == sects[i]->index) { sym->section = i + 1; break; } } - if (nsects && i == nsects) - nasm_error(ERR_PANIC, "strange segment conditions in ELF driver"); } if (is_global == 2) { |