From: nasm-bot f. C. G. <gor...@gm...> - 2016-04-21 06:18:22
|
Commit-ID: ca40da311b81f976828cd23843499c5a551bfb23 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=ca40da311b81f976828cd23843499c5a551bfb23 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 13 Mar 2016 13:43:14 +0300 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Mon, 11 Apr 2016 00:07:14 +0300 out: Elf32, Elfx32, Elf64 -- more unifications Some elf_ section numbers may be unused. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 7 +++---- output/outelf64.c | 12 +++++------- output/outelfx32.c | 6 +++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 3d72f6c..2868090 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -177,12 +177,11 @@ static void dwarf_findsect(const int); /* * Special NASM section numbers which are used to define ELF special - * symbols, which can be used with WRT to provide PIC and TLS - * relocation types. + * 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, elf_tlsie_sect; +static int32_t elf_sym_sect, elf_gottpoff_sect, elf_tlsie_sect; static void elf_init(void) { @@ -297,7 +296,7 @@ static int32_t elf_section_names(char *name, int pass, int *bits) flags_and = flags_or = type = align = 0; elf_section_attrib(name, p, pass, &flags_and, - &flags_or, &align, &type); + &flags_or, &align, &type); if (!strcmp(name, ".shstrtab") || !strcmp(name, ".symtab") || diff --git a/output/outelf64.c b/output/outelf64.c index cfb6e57..fd23502 100644 --- a/output/outelf64.c +++ b/output/outelf64.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) { @@ -328,8 +326,8 @@ static int32_t elf_section_names(char *name, int pass, int *bits) i = elf_make_section(name, type, flags, align); } else if (pass == 1) { if ((type && sects[i]->type != type) - || (align && sects[i]->align != align) - || (flags_and && ((sects[i]->flags & flags_and) != flags_or))) + || (align && sects[i]->align != align) + || (flags_and && ((sects[i]->flags & flags_and) != flags_or))) nasm_error(ERR_WARNING, "incompatible section attributes ignored on" " redeclaration of section `%s'", name); } diff --git a/output/outelfx32.c b/output/outelfx32.c index 3a0bac8..2df8607 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -299,7 +299,7 @@ static int32_t elf_section_names(char *name, int pass, int *bits) flags_and = flags_or = type = align = 0; elf_section_attrib(name, p, pass, &flags_and, - &flags_or, &align, &type); + &flags_or, &align, &type); if (!strcmp(name, ".shstrtab") || !strcmp(name, ".symtab") || @@ -328,8 +328,8 @@ static int32_t elf_section_names(char *name, int pass, int *bits) i = elf_make_section(name, type, flags, align); } else if (pass == 1) { if ((type && sects[i]->type != type) - || (align && sects[i]->align != align) - || (flags_and && ((sects[i]->flags & flags_and) != flags_or))) + || (align && sects[i]->align != align) + || (flags_and && ((sects[i]->flags & flags_and) != flags_or))) nasm_error(ERR_WARNING, "incompatible section attributes ignored on" " redeclaration of section `%s'", name); } |