You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(71) |
Aug
(152) |
Sep
(123) |
Oct
(49) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2002 |
Jan
|
Feb
|
Mar
|
Apr
(37) |
May
(554) |
Jun
(301) |
Jul
(84) |
Aug
(39) |
Sep
(44) |
Oct
(99) |
Nov
(41) |
Dec
(52) |
2003 |
Jan
(15) |
Feb
(32) |
Mar
(19) |
Apr
(4) |
May
(8) |
Jun
(30) |
Jul
(122) |
Aug
(100) |
Sep
(120) |
Oct
(4) |
Nov
(39) |
Dec
(32) |
2004 |
Jan
(38) |
Feb
(87) |
Mar
(11) |
Apr
(23) |
May
(7) |
Jun
(6) |
Jul
(18) |
Aug
(2) |
Sep
(22) |
Oct
(2) |
Nov
(7) |
Dec
(48) |
2005 |
Jan
(74) |
Feb
(29) |
Mar
(28) |
Apr
(1) |
May
(24) |
Jun
(16) |
Jul
(9) |
Aug
(7) |
Sep
(69) |
Oct
(11) |
Nov
(13) |
Dec
(13) |
2006 |
Jan
(5) |
Feb
(3) |
Mar
(7) |
Apr
|
May
(12) |
Jun
(12) |
Jul
(5) |
Aug
(1) |
Sep
(4) |
Oct
(61) |
Nov
(68) |
Dec
(46) |
2007 |
Jan
(16) |
Feb
(15) |
Mar
(46) |
Apr
(171) |
May
(78) |
Jun
(109) |
Jul
(61) |
Aug
(71) |
Sep
(189) |
Oct
(219) |
Nov
(162) |
Dec
(91) |
2008 |
Jan
(49) |
Feb
(41) |
Mar
(43) |
Apr
(31) |
May
(70) |
Jun
(98) |
Jul
(39) |
Aug
(8) |
Sep
(75) |
Oct
(47) |
Nov
(11) |
Dec
(17) |
2009 |
Jan
(9) |
Feb
(12) |
Mar
(8) |
Apr
(11) |
May
(27) |
Jun
(25) |
Jul
(161) |
Aug
(28) |
Sep
(66) |
Oct
(36) |
Nov
(49) |
Dec
(22) |
2010 |
Jan
(34) |
Feb
(20) |
Mar
(3) |
Apr
(12) |
May
(1) |
Jun
(10) |
Jul
(28) |
Aug
(98) |
Sep
(7) |
Oct
(25) |
Nov
(4) |
Dec
(9) |
2011 |
Jan
|
Feb
(12) |
Mar
(7) |
Apr
(16) |
May
(11) |
Jun
(59) |
Jul
(120) |
Aug
(7) |
Sep
(4) |
Oct
(5) |
Nov
(3) |
Dec
(2) |
2012 |
Jan
|
Feb
(6) |
Mar
(21) |
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
(5) |
Oct
(3) |
Nov
(6) |
Dec
(1) |
2013 |
Jan
|
Feb
(19) |
Mar
(10) |
Apr
|
May
(2) |
Jun
|
Jul
(7) |
Aug
(62) |
Sep
(14) |
Oct
(44) |
Nov
(38) |
Dec
(47) |
2014 |
Jan
(14) |
Feb
(1) |
Mar
(4) |
Apr
|
May
(20) |
Jun
|
Jul
|
Aug
(8) |
Sep
(6) |
Oct
(11) |
Nov
(9) |
Dec
(9) |
2015 |
Jan
(3) |
Feb
(2) |
Mar
(2) |
Apr
(3) |
May
(2) |
Jun
(5) |
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(1) |
Nov
(10) |
Dec
(2) |
2016 |
Jan
(12) |
Feb
(13) |
Mar
(9) |
Apr
(45) |
May
(9) |
Jun
(2) |
Jul
(15) |
Aug
(32) |
Sep
(6) |
Oct
(28) |
Nov
(1) |
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
(13) |
May
(8) |
Jun
(2) |
Jul
(3) |
Aug
(10) |
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2018 |
Jan
(2) |
Feb
(4) |
Mar
(2) |
Apr
(7) |
May
|
Jun
(8) |
Jul
|
Aug
(8) |
Sep
(2) |
Oct
(2) |
Nov
(8) |
Dec
(6) |
2019 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2020 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:19
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 37 ++++++++++++++++++------------------- output/outelf64.c | 13 +++++++------ output/outelfx32.c | 13 +++++++------ 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 4f959cd..494710e 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -607,9 +607,9 @@ static void elf_add_reloc(struct elf_section *sect, int32_t segment, * Inefficiency: we search, currently, using a linked list which * isn't even necessarily sorted. */ -static int32_t elf_add_gsym_reloc(struct elf_section *sect, - int32_t segment, uint32_t offset, - int type, bool exact) +static int64_t elf_add_gsym_reloc(struct elf_section *sect, + int32_t segment, uint64_t offset, int64_t pcrel, + int type, bool exact) { struct elf_reloc *r; struct elf_section *s; @@ -633,11 +633,10 @@ static int32_t elf_add_gsym_reloc(struct elf_section *sect, if (!s) { if (exact && offset) - nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol" - " for this reference"); + nasm_error(ERR_NONFATAL, "invalid access to an external symbol"); else - elf_add_reloc(sect, segment, 0, type); - return offset; + elf_add_reloc(sect, segment, offset - pcrel, type); + return 0; } srb = rb_search(s->gsyms, offset); @@ -653,12 +652,12 @@ static int32_t elf_add_gsym_reloc(struct elf_section *sect, r->next = NULL; r->address = sect->len; + r->offset = offset - pcrel - sym->symv.key; r->symbol = GLOBAL_TEMP_BASE + sym->globnum; r->type = type; sect->nrelocs++; - - return offset - sym->symv.key; + return r->offset; } static void elf_out(int32_t segto, const void *data, @@ -773,26 +772,26 @@ static void elf_out(int32_t segto, const void *data, } else if (wrt == elf_gotoff_sect + 1) { elf_add_reloc(s, segment, 0, R_386_GOTOFF); } else if (wrt == elf_tlsie_sect + 1) { - addr = elf_add_gsym_reloc(s, segment, addr, - R_386_TLS_IE, true); + addr = elf_add_gsym_reloc(s, segment, addr, 0, + R_386_TLS_IE, true); } else if (wrt == elf_got_sect + 1) { - addr = elf_add_gsym_reloc(s, segment, addr, - R_386_GOT32, true); + addr = elf_add_gsym_reloc(s, segment, addr, 0, + R_386_GOT32, true); } else if (wrt == elf_sym_sect + 1) { switch (asize) { case 1: gnu16 = true; - addr = elf_add_gsym_reloc(s, segment, addr, - R_386_8, false); + addr = elf_add_gsym_reloc(s, segment, addr, 0, + R_386_8, false); break; case 2: gnu16 = true; - addr = elf_add_gsym_reloc(s, segment, addr, - R_386_16, false); + addr = elf_add_gsym_reloc(s, segment, addr, 0, + R_386_16, false); break; case 4: - addr = elf_add_gsym_reloc(s, segment, addr, - R_386_32, false); + addr = elf_add_gsym_reloc(s, segment, addr, 0, + R_386_32, false); break; default: break; diff --git a/output/outelf64.c b/output/outelf64.c index 4730bf6..e05a849 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -607,9 +607,9 @@ static void elf_add_reloc(struct elf_section *sect, int32_t segment, * Inefficiency: we search, currently, using a linked list which * isn't even necessarily sorted. */ -static void elf_add_gsym_reloc(struct elf_section *sect, - int32_t segment, uint64_t offset, int64_t pcrel, - int type, bool exact) +static int64_t elf_add_gsym_reloc(struct elf_section *sect, + int32_t segment, uint64_t offset, int64_t pcrel, + int type, bool exact) { struct elf_reloc *r; struct elf_section *s; @@ -636,27 +636,28 @@ static void elf_add_gsym_reloc(struct elf_section *sect, nasm_error(ERR_NONFATAL, "invalid access to an external symbol"); else elf_add_reloc(sect, segment, offset - pcrel, type); - return; + return 0; } srb = rb_search(s->gsyms, offset); if (!srb || (exact && srb->key != offset)) { nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol" " for this reference"); - return; + return 0; } sym = container_of(srb, struct elf_symbol, symv); r = *sect->tail = nasm_malloc(sizeof(struct elf_reloc)); sect->tail = &r->next; - r->next = NULL; + r->next = NULL; r->address = sect->len; r->offset = offset - pcrel - sym->symv.key; r->symbol = GLOBAL_TEMP_BASE + sym->globnum; r->type = type; sect->nrelocs++; + return r->offset; } static void elf_out(int32_t segto, const void *data, diff --git a/output/outelfx32.c b/output/outelfx32.c index 99d92a7..45a949b 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -608,9 +608,9 @@ static void elf_add_reloc(struct elf_section *sect, int32_t segment, * Inefficiency: we search, currently, using a linked list which * isn't even necessarily sorted. */ -static void elf_add_gsym_reloc(struct elf_section *sect, - int32_t segment, uint32_t offset, int32_t pcrel, - int type, bool exact) +static int64_t elf_add_gsym_reloc(struct elf_section *sect, + int32_t segment, uint64_t offset, int64_t pcrel, + int type, bool exact) { struct elf_reloc *r; struct elf_section *s; @@ -637,27 +637,28 @@ static void elf_add_gsym_reloc(struct elf_section *sect, nasm_error(ERR_NONFATAL, "invalid access to an external symbol"); else elf_add_reloc(sect, segment, offset - pcrel, type); - return; + return 0; } srb = rb_search(s->gsyms, offset); if (!srb || (exact && srb->key != offset)) { nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol" " for this reference"); - return; + return 0; } sym = container_of(srb, struct elf_symbol, symv); r = *sect->tail = nasm_malloc(sizeof(struct elf_reloc)); sect->tail = &r->next; - r->next = NULL; + r->next = NULL; r->address = sect->len; r->offset = offset - pcrel - sym->symv.key; r->symbol = GLOBAL_TEMP_BASE + sym->globnum; r->type = type; sect->nrelocs++; + return r->offset; } static void elf_out(int32_t segto, const void *data, -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:19
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 494710e..ace4630 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -819,12 +819,12 @@ static void elf_out(int32_t segto, const void *data, } case OUT_REL1ADR: - bytes = 1; reltype = R_386_PC8; + bytes = 1; goto rel12adr; case OUT_REL2ADR: - bytes = 2; reltype = R_386_PC16; + bytes = 2; goto rel12adr; rel12adr: -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:18
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 12255fd..4f959cd 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -945,8 +945,8 @@ static void elf_write(void) fputc(elf_osabi, ofile); fputc(elf_abiver, ofile); fwritezero(7, ofile); - fwriteint16_t(1, ofile); /* ET_REL relocatable file */ - fwriteint16_t(3, ofile); /* EM_386 processor ID */ + fwriteint16_t(ET_REL, ofile); /* relocatable file */ + fwriteint16_t(EM_386, ofile); /* processor ID */ fwriteint32_t(1L, ofile); /* EV_CURRENT file format version */ fwriteint32_t(0L, ofile); /* no entry point */ fwriteint32_t(0L, ofile); /* no program header table */ @@ -956,7 +956,7 @@ static void elf_write(void) fwriteint16_t(0x34, ofile); /* size of ELF header */ fwriteint16_t(0, ofile); /* no program header table, again */ fwriteint16_t(0, ofile); /* still no program header table */ - fwriteint16_t(0x28, ofile); /* size of section header */ + fwriteint16_t(sizeof(Elf32_Shdr), ofile); /* size of section header */ fwriteint16_t(nsections, ofile); /* number of sections */ fwriteint16_t(sec_shstrtab, ofile); /* string table section index for * section header table */ -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:18
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 2 ++ output/outelf64.c | 2 ++ output/outelfx32.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/output/outelf32.c b/output/outelf32.c index 67c0907..12255fd 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -83,6 +83,8 @@ static struct elf_symbol *fwds; static char elf_module[FILENAME_MAX]; extern const struct ofmt of_elf32; +extern const struct ofmt of_elf64; +extern const struct ofmt of_elfx32; static struct ELF_SECTDATA { void *data; diff --git a/output/outelf64.c b/output/outelf64.c index 91d50e8..4730bf6 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -82,7 +82,9 @@ static struct elf_symbol *fwds; static char elf_module[FILENAME_MAX]; +extern const struct ofmt of_elf32; extern const struct ofmt of_elf64; +extern const struct ofmt of_elfx32; static struct ELF_SECTDATA { void *data; diff --git a/output/outelfx32.c b/output/outelfx32.c index b5f62a6..99d92a7 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -82,6 +82,8 @@ static struct elf_symbol *fwds; static char elf_module[FILENAME_MAX]; +extern const struct ofmt of_elf32; +extern const struct ofmt of_elf64; extern const struct ofmt of_elfx32; static struct ELF_SECTDATA { -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:17
|
We rather need a trace engine. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf64.c | 11 ----------- output/outelfx32.c | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/output/outelf64.c b/output/outelf64.c index 460dc01..91d50e8 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -667,17 +667,6 @@ static void elf_out(int32_t segto, const void *data, int i; static struct symlininfo sinfo; -#if defined(DEBUG) && DEBUG>2 - if (data) - nasm_error(ERR_DEBUG, - " elf_out line: %d type: %x seg: %"PRIx32" segto: %"PRIx32" bytes: %"PRIx64" data: %"PRIx64"\n", - currentline, type, segment, segto, size, *(int64_t *)data); - else - nasm_error(ERR_DEBUG, - " elf_out line: %d type: %x seg: %"PRIx32" segto: %"PRIx32" bytes: %"PRIx64"\n", - currentline, type, segment, segto, size); -#endif - /* * handle absolute-assembly (structure definitions) */ diff --git a/output/outelfx32.c b/output/outelfx32.c index ed1a99e..b5f62a6 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -668,17 +668,6 @@ static void elf_out(int32_t segto, const void *data, int i; static struct symlininfo sinfo; -#if defined(DEBUG) && DEBUG>2 - if (data) - nasm_error(ERR_DEBUG, - " elf_out line: %d type: %x seg: %"PRIx32" segto: %"PRIx32" bytes: %"PRIx64" data: %"PRIx64"\n", - currentline, type, segment, segto, size, *(int64_t *)data); - else - nasm_error(ERR_DEBUG, - " elf_out line: %d type: %x seg: %"PRIx32" segto: %"PRIx32" bytes: %"PRIx64"\n", - currentline, type, segment, segto, size); -#endif - /* * handle absolute-assembly (structure definitions) */ -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:17
|
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; } -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:16
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 2 +- output/outelf64.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 2868090..afd9438 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -151,7 +151,7 @@ static uint8_t *arangesbuf = 0, *arangesrelbuf = 0, *pubnamesbuf = 0, *infobuf = static int8_t line_base = -5, line_range = 14, opcode_base = 13; static int arangeslen, arangesrellen, pubnameslen, infolen, inforellen, abbrevlen, linelen, linerellen, framelen, loclen; -static int32_t dwarf_infosym, dwarf_abbrevsym, dwarf_linesym; +static int64_t dwarf_infosym, dwarf_abbrevsym, dwarf_linesym; static const struct dfmt df_dwarf; static const struct dfmt df_stabs; diff --git a/output/outelf64.c b/output/outelf64.c index fd23502..93696b1 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -153,7 +153,6 @@ static int arangeslen, arangesrellen, pubnameslen, infolen, inforellen, abbrevlen, linelen, linerellen, framelen, loclen; static int64_t dwarf_infosym, dwarf_abbrevsym, dwarf_linesym; - static const struct dfmt df_dwarf; static const struct dfmt df_stabs; static struct elf_symbol *lastsym; -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:16
|
elf_sect_writeaddr is unused by now. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 19 ++++++++++++------- output/outelfx32.c | 11 ++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 67cdaa3..3d72f6c 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -93,9 +93,9 @@ static int elf_nsect, nsections; static int64_t elf_foffs; static void elf_write(void); -static void elf_sect_write(struct elf_section *, const uint8_t *, - uint32_t); -static void elf_section_header(int, int, int, void *, bool, int32_t, int, int, +static void elf_sect_write(struct elf_section *, const void *, size_t); +static void elf_sect_writeaddr(struct elf_section *, int64_t, size_t); +static void elf_section_header(int, int, uint64_t, void *, bool, uint64_t, int, int, int, int); static void elf_write_sections(void); static struct SAA *elf_build_symtab(int32_t *, int32_t *); @@ -1246,8 +1246,8 @@ static struct SAA *elf_build_reltab(uint64_t *len, struct elf_reloc *r) return s; } -static void elf_section_header(int name, int type, int flags, - void *data, bool is_saa, int32_t datalen, +static void elf_section_header(int name, int type, uint64_t flags, + void *data, bool is_saa, uint64_t datalen, int link, int info, int align, int eltsize) { elf_sects[elf_nsect].data = data; @@ -1285,13 +1285,18 @@ static void elf_write_sections(void) } } -static void elf_sect_write(struct elf_section *sect, - const uint8_t *data, uint32_t len) +static void elf_sect_write(struct elf_section *sect, const void *data, size_t len) { saa_wbytes(sect->data, data, len); sect->len += len; } +static void elf_sect_writeaddr(struct elf_section *sect, int64_t data, size_t len) +{ + saa_writeaddr(sect->data, data, len); + sect->len += len; +} + static void elf_sectalign(int32_t seg, unsigned int value) { struct elf_section *s = NULL; diff --git a/output/outelfx32.c b/output/outelfx32.c index 5e83239..3a0bac8 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -94,8 +94,8 @@ static int64_t elf_foffs; static void elf_write(void); static void elf_sect_write(struct elf_section *, const void *, size_t); -static void elf_sect_writeaddr(struct elf_section *, int32_t, size_t); -static void elf_section_header(int, int, uint32_t, void *, bool, uint32_t, int, int, +static void elf_sect_writeaddr(struct elf_section *, int64_t, size_t); +static void elf_section_header(int, int, uint64_t, void *, bool, uint64_t, int, int, int, int); static void elf_write_sections(void); static struct SAA *elf_build_symtab(int32_t *, int32_t *); @@ -1283,8 +1283,8 @@ static struct SAA *elf_build_reltab(uint64_t *len, struct elf_reloc *r) return s; } -static void elf_section_header(int name, int type, uint32_t flags, - void *data, bool is_saa, uint32_t datalen, +static void elf_section_header(int name, int type, uint64_t flags, + void *data, bool is_saa, uint64_t datalen, int link, int info, int align, int eltsize) { elf_sects[elf_nsect].data = data; @@ -1327,7 +1327,8 @@ static void elf_sect_write(struct elf_section *sect, const void *data, size_t le saa_wbytes(sect->data, data, len); sect->len += len; } -static void elf_sect_writeaddr(struct elf_section *sect, int32_t data, size_t len) + +static void elf_sect_writeaddr(struct elf_section *sect, int64_t data, size_t len) { saa_writeaddr(sect->data, data, len); sect->len += len; -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:15
|
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); } -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:14
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf64.c | 4 +--- output/outelfx32.c | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/output/outelf64.c b/output/outelf64.c index 7aed5a2..cfb6e57 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -217,7 +217,6 @@ static void elf_init(void) define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false); def_seg = seg_alloc(); - } static void elf_cleanup(void) @@ -1835,8 +1834,7 @@ static void dwarf_generate(void) psect = dwarf_fsect; totlen = 0; highaddr = 0; - for (indx = 0; indx < dwarf_nsections; indx++) - { + for (indx = 0; indx < dwarf_nsections; indx++) { plinep = psect->psaa; /* Line Number Program Epilogue */ saa_write8(plinep,2); /* std op 2 */ diff --git a/output/outelfx32.c b/output/outelfx32.c index 1c504db..5e83239 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -217,7 +217,6 @@ static void elf_init(void) define_label("..gottpoff", elf_gottpoff_sect + 1, 0L, NULL, false, false); def_seg = seg_alloc(); - } static void elf_cleanup(void) -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:14
|
Use int64_t. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 4 ++-- output/outelfx32.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 961c883..67cdaa3 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -86,11 +86,11 @@ extern const struct ofmt of_elf32; static struct ELF_SECTDATA { void *data; - int32_t len; + int64_t len; bool is_saa; } *elf_sects; static int elf_nsect, nsections; -static int32_t elf_foffs; +static int64_t elf_foffs; static void elf_write(void); static void elf_sect_write(struct elf_section *, const uint8_t *, diff --git a/output/outelfx32.c b/output/outelfx32.c index 37d5dca..1c504db 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -86,11 +86,11 @@ extern const struct ofmt of_elfx32; static struct ELF_SECTDATA { void *data; - int32_t len; + int64_t len; bool is_saa; } *elf_sects; static int elf_nsect, nsections; -static int32_t elf_foffs; +static int64_t elf_foffs; static void elf_write(void); static void elf_sect_write(struct elf_section *, const void *, size_t); -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:13
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf.h | 5 +---- output/outelf32.c | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/output/outelf.h b/output/outelf.h index 4d6db5d..909ea88 100644 --- a/output/outelf.h +++ b/output/outelf.h @@ -50,10 +50,7 @@ /* alignment of sections in file */ #define SEC_FILEALIGN 16 -/* this stuff is needed for the stabs debugging format */ -#define TY_STABSSYMLIN 0x40 /* ouch */ - -/* this stuff is needed for the dwarf debugging format */ +/* this stuff is needed for the dwarf/stabs debugging format */ #define TY_DEBUGSYMLIN 0x40 /* internal call to debug_out */ /* Known sections with nonstandard defaults */ diff --git a/output/outelf32.c b/output/outelf32.c index c9d4af6..961c883 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -692,7 +692,7 @@ static void elf_out(int32_t segto, const void *data, sinfo.section = i; sinfo.segto = segto; sinfo.name = s->name; - dfmt->debug_output(TY_STABSSYMLIN, &sinfo); + dfmt->debug_output(TY_DEBUGSYMLIN, &sinfo); /* end of debugging stuff */ if (s->type == SHT_NOBITS && type != OUT_RESERVE) { @@ -1471,7 +1471,7 @@ static void stabs_output(int type, void *param) { struct symlininfo *s; struct linelist *el; - if (type == TY_STABSSYMLIN) { + if (type == TY_DEBUGSYMLIN) { if (debug_immcall) { s = (struct symlininfo *)param; if (!(sects[s->section]->flags & SHF_EXECINSTR)) -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:13
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 15 ++++----------- output/outelf64.c | 9 ++------- output/outelfx32.c | 9 ++------- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 0e680c7..ab62b6e 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -964,7 +964,7 @@ static void elf_write(void) * Now output the section header table. */ - elf_foffs = 0x40 + 0x28 * nsections; + elf_foffs = 0x40 + sizeof(Elf32_Shdr) * nsections; align = ALIGN(elf_foffs, SEC_FILEALIGN) - elf_foffs; elf_foffs += align; elf_nsect = 0; @@ -1153,7 +1153,6 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local) * dwarf needs symbols for debug sections * which are relocation targets. */ - /*** fix for 32 bit ***/ if (dfmt == &df_dwarf) { dwarf_infosym = *local; p = entry; @@ -1374,8 +1373,7 @@ const struct ofmt of_elf32 = { elf_cleanup }; -/* again, the stabs debugging stuff (code) */ - +/* common debugging routines */ static void debug_typevalue(int32_t type) { int32_t stype, ssize; @@ -1445,11 +1443,9 @@ static void debug_typevalue(int32_t type) /* stabs debugging routines */ -static void stabs_linenum(const char *filename, int32_t linenumber, - int32_t segto) +static void stabs_linenum(const char *filename, int32_t linenumber, int32_t segto) { (void)segto; - if (!stabs_filename) { stabs_filename = (char *)nasm_malloc(strlen(filename) + 1); strcpy(stabs_filename, filename); @@ -1459,7 +1455,6 @@ static void stabs_linenum(const char *filename, int32_t linenumber, in fact, this leak comes in quite handy to maintain a list of files encountered so far in the symbol lines... */ - /* why not nasm_free(stabs_filename); we're done with the old one */ stabs_filename = (char *)nasm_malloc(strlen(filename) + 1); @@ -1512,9 +1507,7 @@ static void stabs_generate(void) ptr = stabslines; - allfiles = (char **)nasm_malloc(numlinestabs * sizeof(char *)); - for (i = 0; i < numlinestabs; i++) - allfiles[i] = 0; + allfiles = (char **)nasm_zalloc(numlinestabs * sizeof(char *)); numfiles = 0; while (ptr) { if (numfiles == 0) { diff --git a/output/outelf64.c b/output/outelf64.c index 1f8247a..7aed5a2 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -986,9 +986,7 @@ static void elf_write(void) add_sectname("", ".stab"); add_sectname("", ".stabstr"); add_sectname(".rel", ".stab"); - } - - else if (dfmt == &df_dwarf) { + } else if (dfmt == &df_dwarf) { /* the dwarf debug standard specifies the following ten sections, not all of which are currently implemented, although all of them are defined. */ @@ -1210,7 +1208,6 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local) (*local)++; } - /* * Now the other local symbols. */ @@ -1552,7 +1549,6 @@ static void stabs_linenum(const char *filename, int32_t linenumber, int32_t segt currentline = linenumber; } - static void stabs_output(int type, void *param) { struct symlininfo *s; @@ -1991,8 +1987,7 @@ static void dwarf_generate(void) saa_write8(plines,0); /* End of table */ /* File Name Table */ ftentry = dwarf_flist; - for (indx = 0;indx<dwarf_numfiles;indx++) - { + for (indx = 0; indx < dwarf_numfiles; indx++) { saa_wbytes(plines, ftentry->filename, (int32_t)(strlen(ftentry->filename) + 1)); saa_write8(plines,0); /* directory LEB128u */ saa_write8(plines,0); /* time LEB128u */ diff --git a/output/outelfx32.c b/output/outelfx32.c index ed94942..37d5dca 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -949,9 +949,7 @@ static void elf_write(void) add_sectname("", ".stab"); add_sectname("", ".stabstr"); add_sectname(".rel", ".stab"); - } - - else if (dfmt == &df_dwarf) { + } else if (dfmt == &df_dwarf) { /* the dwarf debug standard specifies the following ten sections, not all of which are currently implemented, although all of them are defined. */ @@ -1172,7 +1170,6 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local) (*local)++; } - /* * Now the other local symbols. */ @@ -1512,7 +1509,6 @@ static void stabs_linenum(const char *filename, int32_t linenumber, int32_t segt currentline = linenumber; } - static void stabs_output(int type, void *param) { struct symlininfo *s; @@ -1948,8 +1944,7 @@ static void dwarf_generate(void) saa_write8(plines,0); /* End of table */ /* File Name Table */ ftentry = dwarf_flist; - for (indx = 0;indx<dwarf_numfiles;indx++) - { + for (indx = 0; indx < dwarf_numfiles; indx++) { saa_wbytes(plines, ftentry->filename, (int32_t)(strlen(ftentry->filename) + 1)); saa_write8(plines,0); /* directory LEB128u */ saa_write8(plines,0); /* time LEB128u */ -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:13
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/output/outelf32.c b/output/outelf32.c index ab62b6e..c9d4af6 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -108,7 +108,8 @@ struct erel { struct symlininfo { int offset; - int section; /* section index */ + int section; /* index into sects[] */ + int segto; /* internal section number */ char *name; /* shallow-copied pointer of section name */ }; @@ -689,6 +690,7 @@ static void elf_out(int32_t segto, const void *data, /* again some stabs debugging stuff */ sinfo.offset = s->len; sinfo.section = i; + sinfo.segto = segto; sinfo.name = s->name; dfmt->debug_output(TY_STABSSYMLIN, &sinfo); /* end of debugging stuff */ -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:12
|
Not everything yet covered but just to share for easier review. It's sitting in https://github.com/cyrillos/nasm/tree/uelf The series is on top of 89c1770e14c8ca3fa478ddf3106f76835fc0704f Cyrill Gorcunov (18): out: Elfx32, Elf32 -- Unify elf_add_reloc out: Elf32 -- Add missing comment out: Elf32, Elfx32, Elf64 -- Use ofmt->maxbits out: Elf64, Elf32, Elfx32 -- Style merge out: Elf32 -- Unify struct symlininfo out: Elf32 -- Reuse TY_DEBUGSYMLIN out: Elf32, Elfx32 -- Unify struct ELF_SECTDATA and @elf_foffs out: Elf64, Elfx32 -- Style fix out: Elf32, Elfx32 -- Unify elf_sect_write, elf_section_header and add elf_sect_writeaddr out: Elf32, Elfx32, Elf64 -- more unifications out: Elf32 -- Unify dwarf_ nums out: Elf32, Elfx32, Elf64 -- Unify elf_init and elf_deflabel out: Elf64, Elfx32 -- Drop useless DEBUG output: Elf32, Elfx32, Elf64 -- Declare ofmt for all out: Elf32 -- A few more constants usage output: Elf32, Elfx32 -- Unify elf_add_gsym_reloc output: Elf32 -- Shuffle few lines to make it close to other code output: Elf32, Elfx32 -- Use 64 bit address output/outelf.h | 5 +- output/outelf32.c | 169 +++++++++++++++++++++++++++-------------------------- output/outelf64.c | 69 +++++++++------------- output/outelfx32.c | 86 +++++++++++++-------------- 4 files changed, 156 insertions(+), 173 deletions(-) -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:12
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 5 +---- output/outelf64.c | 5 +---- output/outelfx32.c | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index a0c5e83..0e680c7 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -285,11 +285,8 @@ static int32_t elf_section_names(char *name, int pass, int *bits) uint64_t align; int type, i; - /* - * Default is 32 bits. - */ if (!name) { - *bits = 32; + *bits = ofmt->maxbits; return def_seg; } diff --git a/output/outelf64.c b/output/outelf64.c index 5a177cb..1f8247a 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -289,11 +289,8 @@ static int32_t elf_section_names(char *name, int pass, int *bits) uint64_t align; int type, i; - /* - * Default is 64 bits. - */ if (!name) { - *bits = 64; + *bits = ofmt->maxbits; return def_seg; } diff --git a/output/outelfx32.c b/output/outelfx32.c index e601d35..ed94942 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -289,11 +289,8 @@ static int32_t elf_section_names(char *name, int pass, int *bits) uint64_t align; int type, i; - /* - * Default is 64 bits. - */ if (!name) { - *bits = 64; + *bits = ofmt->maxbits; return def_seg; } -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:11
|
Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/output/outelf32.c b/output/outelf32.c index 3083b10..a0c5e83 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -240,6 +240,7 @@ static void elf_cleanup(void) dfmt->cleanup(); } +/* add entry to the elf .shstrtab section */ static void add_sectname(char *firsthalf, char *secondhalf) { int len = strlen(firsthalf) + strlen(secondhalf); -- 2.5.5 |
From: Cyrill G. <gor...@gm...> - 2016-04-07 22:17:11
|
Make offset being int64_t and use 0 for Elf32. Thus it gonna be the same for all Elfs. Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/outelf32.c | 23 +++++++++++++---------- output/outelfx32.c | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index b2ba68a..3083b10 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -551,7 +551,8 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, nasm_error(ERR_NONFATAL, "no special symbol features supported here"); } -static void elf_add_reloc(struct elf_section *sect, int32_t segment, int type) +static void elf_add_reloc(struct elf_section *sect, int32_t segment, + int64_t offset, int type) { struct elf_reloc *r; @@ -559,6 +560,8 @@ static void elf_add_reloc(struct elf_section *sect, int32_t segment, int type) sect->tail = &r->next; r->address = sect->len; + r->offset = offset; + if (segment != NO_SEG) { int i; for (i = 0; i < nsects; i++) @@ -623,7 +626,7 @@ static int32_t elf_add_gsym_reloc(struct elf_section *sect, nasm_error(ERR_NONFATAL, "unable to find a suitable global symbol" " for this reference"); else - elf_add_reloc(sect, segment, type); + elf_add_reloc(sect, segment, 0, type); return offset; } @@ -736,14 +739,14 @@ static void elf_out(int32_t segto, const void *data, switch (asize) { case 1: gnu16 = true; - elf_add_reloc(s, segment, R_386_8); + elf_add_reloc(s, segment, 0, R_386_8); break; case 2: gnu16 = true; - elf_add_reloc(s, segment, R_386_16); + elf_add_reloc(s, segment, 0, R_386_16); break; case 4: - elf_add_reloc(s, segment, R_386_32); + elf_add_reloc(s, segment, 0, R_386_32); break; default: /* Error issued further down */ break; @@ -755,9 +758,9 @@ static void elf_out(int32_t segto, const void *data, * need to fix up the data item by $-$$. */ addr += s->len; - elf_add_reloc(s, segment, R_386_GOTPC); + elf_add_reloc(s, segment, 0, R_386_GOTPC); } else if (wrt == elf_gotoff_sect + 1) { - elf_add_reloc(s, segment, R_386_GOTOFF); + elf_add_reloc(s, segment, 0, R_386_GOTOFF); } else if (wrt == elf_tlsie_sect + 1) { addr = elf_add_gsym_reloc(s, segment, addr, R_386_TLS_IE, true); @@ -823,7 +826,7 @@ static void elf_out(int32_t segto, const void *data, if (wrt == NO_SEG) { nasm_error(ERR_WARNING | ERR_WARN_GNUELF, "8- or 16-bit relocations in ELF is a GNU extension"); - elf_add_reloc(s, segment, reltype); + elf_add_reloc(s, segment, 0, reltype); } else { nasm_error(ERR_NONFATAL, "Unsupported non-32-bit ELF relocation"); @@ -842,9 +845,9 @@ static void elf_out(int32_t segto, const void *data, " segment base references"); } else { if (wrt == NO_SEG) { - elf_add_reloc(s, segment, R_386_PC32); + elf_add_reloc(s, segment, 0, R_386_PC32); } else if (wrt == elf_plt_sect + 1) { - elf_add_reloc(s, segment, R_386_PLT32); + elf_add_reloc(s, segment, 0, R_386_PLT32); } else if (wrt == elf_gotpc_sect + 1 || wrt == elf_gotoff_sect + 1 || wrt == elf_got_sect + 1) { diff --git a/output/outelfx32.c b/output/outelfx32.c index a95d04d..e601d35 100644 --- a/output/outelfx32.c +++ b/output/outelfx32.c @@ -557,7 +557,7 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, } static void elf_add_reloc(struct elf_section *sect, int32_t segment, - int32_t offset, int type) + int64_t offset, int type) { struct elf_reloc *r; -- 2.5.5 |
From: H. P. A. <hp...@zy...> - 2016-03-31 22:43:39
|
On 03/31/16 07:18, Knut St. Osmundsen wrote: > Hi! > > Just built current git and found that an annoying regression had crept > in since 2.12. The following code does not yield any warnings or errors: > > %ifndef NO_SUCH_DEFINE > %warning "Warnings work!" > %error "Errors works!" > %endif > > Bisecting indicates that 215186fe82c461bc1ccef7bed5c1a1a0253bfcc9 is the > first bad commit. Thanks for the alert!! > PS. Visual C++ 2010 still isn't happy with output/codeview.c, there are > two for loops in register_reloc() that declare variables inside the for > statement. Thanks. This should be easy to fix. I'm surprised that the new warning options don't trigger. -hpa |
From: Knut S. O. <bir...@an...> - 2016-03-31 14:53:32
|
Hi! Just built current git and found that an annoying regression had crept in since 2.12. The following code does not yield any warnings or errors: %ifndef NO_SUCH_DEFINE %warning "Warnings work!" %error "Errors works!" %endif Bisecting indicates that 215186fe82c461bc1ccef7bed5c1a1a0253bfcc9 is the first bad commit. Kind Regards, bird PS. Visual C++ 2010 still isn't happy with output/codeview.c, there are two for loops in register_reloc() that declare variables inside the for statement. |
From: H. P. A. <hp...@zy...> - 2016-03-18 00:21:07
|
Hello, I have pushed out NASM 2.12.01 and the build should happen shortly. These are the user-visible changes for this release: C.1.1 Version 2.12.01 (*) Portability fixes for some platforms. (*) Fix error when not specifying a list file. (*) Correct the handling of macro-local labels in the Codeview debugging format. (*) Add `CLZERO', `MONITORX' and `MWAITX' instructions. -hpa |
From: H. P. A. <hp...@zy...> - 2016-03-16 21:17:15
|
The git and http services on terminus.zytor.com (including www|git.syslinux.org and www|git.nasm.us) have been temporarily disabled pending a critical security update. I hope to restore service later today. -hpa |
From: H. P. A. <hp...@zy...> - 2016-03-09 00:35:50
|
I'm wondering if there is anyone who might be interested in working with this guy to get the djgpp cross-compiler into the Fedora repos? https://groups.google.com/forum/m/#!topic/comp.os.msdos.djgpp/8gp0LtLY6DI -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. |
From: Cyrill G. <gor...@gm...> - 2016-03-04 22:39:30
|
http://bugzilla.nasm.us/show_bug.cgi?id=3392336 Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- insns.dat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/insns.dat b/insns.dat index c3bf293..ef797d2 100644 --- a/insns.dat +++ b/insns.dat @@ -799,6 +799,8 @@ MFENCE void [ np 0f ae f0] X64,AMD MONITOR void [ 0f 01 c8] PRESCOTT MONITOR reg_eax,reg_ecx,reg_edx [---: 0f 01 c8] PRESCOTT,NOLONG,ND MONITOR reg_rax,reg_ecx,reg_edx [---: 0f 01 c8] X64,ND +MONITORX void [ 0f 01 fa] X64,AMD +MONITORX reg_rax,reg_ecx,reg_edx [---: 0f 01 fa] X64,AMD,ND MOV mem,reg_sreg [mr: 8c /r] 8086,SW MOV reg16,reg_sreg [mr: o16 8c /r] 8086 MOV reg32,reg_sreg [mr: o32 8c /r] 386 @@ -891,6 +893,8 @@ MUL rm32 [m: o32 f7 /4] 386 MUL rm64 [m: o64 f7 /4] X64 MWAIT void [ 0f 01 c9] PRESCOTT MWAIT reg_eax,reg_ecx [--: 0f 01 c9] PRESCOTT,ND +MWAITX void [ 0f 01 fb] X64,AMD +MWAITX reg_eax,reg_ecx [--: 0f 01 fb] X64,AMD,ND NEG rm8 [m: hle f6 /3] 8086,LOCK NEG rm16 [m: hle o16 f7 /3] 8086,LOCK NEG rm32 [m: hle o32 f7 /3] 386,LOCK -- 2.5.0 |
From: Guillermo B. de Q. M. <deb...@gm...> - 2016-03-04 15:05:22
|
Hi, good afternoon I tried dwarf too but it seems it's not supported too. Thank you very much anyway. Guille 2016-03-04 3:20 GMT+01:00 H. Peter Anvin <hp...@zy...>: > On 12/26/15 23:45, Guillermo Bernaldo de Quiros Maraver wrote: > > > > Here I put the contents of the Makefile: > > all: > > nasm -l main.lst -f elf64 -g -F stabs main.asm > > gcc -gstabs -o main main.o > > > > Are you sure you need stabs rather than dwarf? > > -hpa > > > |