From: nasm-bot f. C. G. <gor...@gm...> - 2016-04-21 06:18:27
|
Commit-ID: dbcaefc98c1dc6fcf8ea5aa555d3358b4425d9a5 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=dbcaefc98c1dc6fcf8ea5aa555d3358b4425d9a5 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 13 Mar 2016 22:43:56 +0300 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Mon, 11 Apr 2016 00:07:14 +0300 out: Elf32, Elfx32, Elf64 -- Unify elf_init and elf_deflabel Note FIXMEs for address later. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 12 +++++++++++- output/outelf64.c | 12 +++++++++++- output/outelfx32.c | 20 ++++++++++++++------ 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index afd9438..67c0907 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -200,6 +200,11 @@ static void elf_init(void) fwds = NULL; + /* + * FIXME: tlsie is Elf32 only and + * gottpoff is Elfx32|64 only. + */ + elf_gotpc_sect = seg_alloc(); define_label("..gotpc", elf_gotpc_sect + 1, 0L, NULL, false, false); elf_gotoff_sect = seg_alloc(); @@ -210,6 +215,8 @@ static void elf_init(void) define_label("..plt", elf_plt_sect + 1, 0L, NULL, false, false); elf_sym_sect = seg_alloc(); define_label("..sym", elf_sym_sect + 1, 0L, NULL, false, false); + elf_gottpoff_sect = seg_alloc(); + define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false); elf_tlsie_sect = seg_alloc(); define_label("..tlsie", elf_tlsie_sect + 1, 0L, NULL, false, false); @@ -351,10 +358,13 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, * This is a NASM special symbol. We never allow it into * the ELF symbol table, even if it's a valid one. If it * _isn't_ a valid one, we should barf immediately. + * + * FIXME: tlsie is Elf32 only, and gottpoff is Elfx32|64 only. */ if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") && strcmp(name, "..got") && strcmp(name, "..plt") && - strcmp(name, "..sym") && strcmp(name, "..tlsie")) + strcmp(name, "..sym") && strcmp(name, "..gottpoff") && + strcmp(name, "..tlsie")) nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name); return; } diff --git a/output/outelf64.c b/output/outelf64.c index 93696b1..460dc01 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -200,6 +200,11 @@ static void elf_init(void) fwds = NULL; + /* + * FIXME: tlsie is Elf32 only and + * gottpoff is Elfx32|64 only. + */ + elf_gotpc_sect = seg_alloc(); define_label("..gotpc", elf_gotpc_sect + 1, 0L, NULL, false, false); elf_gotoff_sect = seg_alloc(); @@ -212,6 +217,8 @@ static void elf_init(void) define_label("..sym", elf_sym_sect + 1, 0L, NULL, false, false); elf_gottpoff_sect = seg_alloc(); define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false); + elf_tlsie_sect = seg_alloc(); + define_label("..tlsie", elf_tlsie_sect + 1, 0L, NULL, false, false); def_seg = seg_alloc(); } @@ -351,10 +358,13 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, * This is a NASM special symbol. We never allow it into * the ELF symbol table, even if it's a valid one. If it * _isn't_ a valid one, we should barf immediately. + * + * FIXME: tlsie is Elf32 only, and gottpoff is Elfx32|64 only. */ if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") && strcmp(name, "..got") && strcmp(name, "..plt") && - strcmp(name, "..sym") && strcmp(name, "..gottpoff")) + strcmp(name, "..sym") && strcmp(name, "..gottpoff") && + strcmp(name, "..tlsie")) nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name); return; } diff --git a/output/outelfx32.c b/output/outelfx32.c index 2df8607..ed1a99e 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -177,14 +177,12 @@ static void dwarf_findfile(const char *); static void dwarf_findsect(const int); /* - * Special section numbers which are used to define ELF special - * symbols, which can be used with WRT to provide PIC relocation - * types. + * Special NASM section numbers which are used to define ELF special + * symbols. */ static int32_t elf_gotpc_sect, elf_gotoff_sect; static int32_t elf_got_sect, elf_plt_sect; -static int32_t elf_sym_sect; -static int32_t elf_gottpoff_sect; +static int32_t elf_sym_sect, elf_gottpoff_sect, elf_tlsie_sect; static void elf_init(void) { @@ -203,6 +201,11 @@ static void elf_init(void) fwds = NULL; + /* + * FIXME: tlsie is Elf32 only and + * gottpoff is Elfx32|64 only. + */ + elf_gotpc_sect = seg_alloc(); define_label("..gotpc", elf_gotpc_sect + 1, 0L, NULL, false, false); elf_gotoff_sect = seg_alloc(); @@ -215,6 +218,8 @@ static void elf_init(void) define_label("..sym", elf_sym_sect + 1, 0L, NULL, false, false); elf_gottpoff_sect = seg_alloc(); define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false); + elf_tlsie_sect = seg_alloc(); + define_label("..tlsie", elf_tlsie_sect + 1, 0L, NULL, false, false); def_seg = seg_alloc(); } @@ -354,10 +359,13 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, * This is a NASM special symbol. We never allow it into * the ELF symbol table, even if it's a valid one. If it * _isn't_ a valid one, we should barf immediately. + * + * FIXME: tlsie is Elf32 only, and gottpoff is Elfx32|64 only. */ if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") && strcmp(name, "..got") && strcmp(name, "..plt") && - strcmp(name, "..sym") && strcmp(name, "..gottpoff")) + strcmp(name, "..sym") && strcmp(name, "..gottpoff") && + strcmp(name, "..tlsie")) nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name); return; } |
From: nasm-bot f. C. G. <gor...@gm...> - 2016-04-24 18:00:22
|
Commit-ID: a087d49f70291d360bb03725a9fd57e30316633a Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=a087d49f70291d360bb03725a9fd57e30316633a Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 13 Mar 2016 22:43:56 +0300 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 24 Apr 2016 20:02:40 +0300 out: Elf32, Elfx32, Elf64 -- Unify elf_init and elf_deflabel Note FIXMEs for address later. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 12 +++++++++++- output/outelf64.c | 12 +++++++++++- output/outelfx32.c | 20 ++++++++++++++------ 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index afd9438..67c0907 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -200,6 +200,11 @@ static void elf_init(void) fwds = NULL; + /* + * FIXME: tlsie is Elf32 only and + * gottpoff is Elfx32|64 only. + */ + elf_gotpc_sect = seg_alloc(); define_label("..gotpc", elf_gotpc_sect + 1, 0L, NULL, false, false); elf_gotoff_sect = seg_alloc(); @@ -210,6 +215,8 @@ static void elf_init(void) define_label("..plt", elf_plt_sect + 1, 0L, NULL, false, false); elf_sym_sect = seg_alloc(); define_label("..sym", elf_sym_sect + 1, 0L, NULL, false, false); + elf_gottpoff_sect = seg_alloc(); + define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false); elf_tlsie_sect = seg_alloc(); define_label("..tlsie", elf_tlsie_sect + 1, 0L, NULL, false, false); @@ -351,10 +358,13 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, * This is a NASM special symbol. We never allow it into * the ELF symbol table, even if it's a valid one. If it * _isn't_ a valid one, we should barf immediately. + * + * FIXME: tlsie is Elf32 only, and gottpoff is Elfx32|64 only. */ if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") && strcmp(name, "..got") && strcmp(name, "..plt") && - strcmp(name, "..sym") && strcmp(name, "..tlsie")) + strcmp(name, "..sym") && strcmp(name, "..gottpoff") && + strcmp(name, "..tlsie")) nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name); return; } diff --git a/output/outelf64.c b/output/outelf64.c index 93696b1..460dc01 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -200,6 +200,11 @@ static void elf_init(void) fwds = NULL; + /* + * FIXME: tlsie is Elf32 only and + * gottpoff is Elfx32|64 only. + */ + elf_gotpc_sect = seg_alloc(); define_label("..gotpc", elf_gotpc_sect + 1, 0L, NULL, false, false); elf_gotoff_sect = seg_alloc(); @@ -212,6 +217,8 @@ static void elf_init(void) define_label("..sym", elf_sym_sect + 1, 0L, NULL, false, false); elf_gottpoff_sect = seg_alloc(); define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false); + elf_tlsie_sect = seg_alloc(); + define_label("..tlsie", elf_tlsie_sect + 1, 0L, NULL, false, false); def_seg = seg_alloc(); } @@ -351,10 +358,13 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, * This is a NASM special symbol. We never allow it into * the ELF symbol table, even if it's a valid one. If it * _isn't_ a valid one, we should barf immediately. + * + * FIXME: tlsie is Elf32 only, and gottpoff is Elfx32|64 only. */ if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") && strcmp(name, "..got") && strcmp(name, "..plt") && - strcmp(name, "..sym") && strcmp(name, "..gottpoff")) + strcmp(name, "..sym") && strcmp(name, "..gottpoff") && + strcmp(name, "..tlsie")) nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name); return; } diff --git a/output/outelfx32.c b/output/outelfx32.c index 2df8607..ed1a99e 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -177,14 +177,12 @@ static void dwarf_findfile(const char *); static void dwarf_findsect(const int); /* - * Special section numbers which are used to define ELF special - * symbols, which can be used with WRT to provide PIC relocation - * types. + * Special NASM section numbers which are used to define ELF special + * symbols. */ static int32_t elf_gotpc_sect, elf_gotoff_sect; static int32_t elf_got_sect, elf_plt_sect; -static int32_t elf_sym_sect; -static int32_t elf_gottpoff_sect; +static int32_t elf_sym_sect, elf_gottpoff_sect, elf_tlsie_sect; static void elf_init(void) { @@ -203,6 +201,11 @@ static void elf_init(void) fwds = NULL; + /* + * FIXME: tlsie is Elf32 only and + * gottpoff is Elfx32|64 only. + */ + elf_gotpc_sect = seg_alloc(); define_label("..gotpc", elf_gotpc_sect + 1, 0L, NULL, false, false); elf_gotoff_sect = seg_alloc(); @@ -215,6 +218,8 @@ static void elf_init(void) define_label("..sym", elf_sym_sect + 1, 0L, NULL, false, false); elf_gottpoff_sect = seg_alloc(); define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false); + elf_tlsie_sect = seg_alloc(); + define_label("..tlsie", elf_tlsie_sect + 1, 0L, NULL, false, false); def_seg = seg_alloc(); } @@ -354,10 +359,13 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, * This is a NASM special symbol. We never allow it into * the ELF symbol table, even if it's a valid one. If it * _isn't_ a valid one, we should barf immediately. + * + * FIXME: tlsie is Elf32 only, and gottpoff is Elfx32|64 only. */ if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") && strcmp(name, "..got") && strcmp(name, "..plt") && - strcmp(name, "..sym") && strcmp(name, "..gottpoff")) + strcmp(name, "..sym") && strcmp(name, "..gottpoff") && + strcmp(name, "..tlsie")) nasm_error(ERR_NONFATAL, "unrecognised special symbol `%s'", name); return; } |