Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(208) |
Jun
(43) |
Jul
|
Aug
(2) |
Sep
(17) |
Oct
|
Nov
(4) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
(11) |
Mar
(3) |
Apr
(2) |
May
|
Jun
(3) |
Jul
(29) |
Aug
(29) |
Sep
(48) |
Oct
|
Nov
|
Dec
(5) |
2004 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(12) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(21) |
Nov
(25) |
Dec
(16) |
2007 |
Jan
(26) |
Feb
(26) |
Mar
(18) |
Apr
(51) |
May
(45) |
Jun
(26) |
Jul
(6) |
Aug
(85) |
Sep
(161) |
Oct
(111) |
Nov
(83) |
Dec
(18) |
2008 |
Jan
(31) |
Feb
(27) |
Mar
|
Apr
(16) |
May
(142) |
Jun
(136) |
Jul
(51) |
Aug
(21) |
Sep
(47) |
Oct
(428) |
Nov
(19) |
Dec
(6) |
2009 |
Jan
(11) |
Feb
(37) |
Mar
(17) |
Apr
(15) |
May
(13) |
Jun
(61) |
Jul
(127) |
Aug
(15) |
Sep
(22) |
Oct
(28) |
Nov
(37) |
Dec
(10) |
2010 |
Jan
(18) |
Feb
(22) |
Mar
(10) |
Apr
(41) |
May
|
Jun
(48) |
Jul
(61) |
Aug
(54) |
Sep
(34) |
Oct
(15) |
Nov
(49) |
Dec
(11) |
2011 |
Jan
|
Feb
(24) |
Mar
(10) |
Apr
(9) |
May
|
Jun
(33) |
Jul
(41) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(86) |
Mar
(12) |
Apr
|
May
(10) |
Jun
|
Jul
(9) |
Aug
(4) |
Sep
(11) |
Oct
(3) |
Nov
(3) |
Dec
(10) |
2013 |
Jan
(1) |
Feb
(23) |
Mar
(15) |
Apr
(7) |
May
(20) |
Jun
(3) |
Jul
(15) |
Aug
|
Sep
(29) |
Oct
(16) |
Nov
(69) |
Dec
(18) |
2014 |
Jan
|
Feb
(8) |
Mar
|
Apr
|
May
(16) |
Jun
(7) |
Jul
|
Aug
(5) |
Sep
(2) |
Oct
(4) |
Nov
(25) |
Dec
(8) |
2015 |
Jan
(6) |
Feb
(6) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(2) |
Oct
(1) |
Nov
(6) |
Dec
|
2016 |
Jan
(12) |
Feb
(97) |
Mar
(57) |
Apr
(52) |
May
(33) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
(3) |
Nov
(3) |
Dec
|
2017 |
Jan
(4) |
Feb
|
Mar
(23) |
Apr
(5) |
May
|
Jun
(2) |
Jul
(3) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(4) |
Feb
(11) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(2) |
2
(1) |
3
(2) |
4
(4) |
5
(2) |
6
(5) |
7
(2) |
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
29
|
30
(1) |
|
|
|
|
|
|
From: H. Peter Anvin <hpa@zy...> - 2008-11-30 23:54:25
|
Date: Sun, 30 Nov 2008 15:53:02 -0800 --- version | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/version b/version index 7dc2698..79ee4ca 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.05.01 +2.06rc1 -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-07 03:57:34
|
Date: Thu, 6 Nov 2008 19:55:05 -0800 Linear searches are evil, so use an llrbtree to search for symbols by offset. This doesn't change the preexisting behaviour that we only look for global symbols. Signed-off-by: H. Peter Anvin <hpa@...> --- Makefile.in | 6 ++- Mkfiles/msvc.mak | 4 +- Mkfiles/netware.mak | 4 +- Mkfiles/openwcom.mak | 4 +- Mkfiles/owlinux.mak | 4 +- output/outelf32.c | 80 ++++++++++++++++++++----------------------------- output/outelf64.c | 63 +++++++++++++++------------------------ 7 files changed, 69 insertions(+), 96 deletions(-) diff --git a/Makefile.in b/Makefile.in index 42f3d96..0471aaf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -293,9 +293,11 @@ output/outcoff.$(O): output/outcoff.c compiler.h config.h insnsi.h nasm.h \ output/outdbg.$(O): output/outdbg.c compiler.h config.h insnsi.h nasm.h \ nasmlib.h outform.h pptok.h preproc.h regs.h output/outelf32.$(O): output/outelf32.c compiler.h config.h insnsi.h nasm.h \ - nasmlib.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + nasmlib.h outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h \ + stdscan.h output/outelf64.$(O): output/outelf64.c compiler.h config.h insnsi.h nasm.h \ - nasmlib.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + nasmlib.h outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h \ + stdscan.h output/outieee.$(O): output/outieee.c compiler.h config.h insnsi.h nasm.h \ nasmlib.h outform.h pptok.h preproc.h regs.h output/outmacho.$(O): output/outmacho.c compiler.h config.h insnsi.h nasm.h \ diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index 21b52bc..a2a5193 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -233,9 +233,9 @@ output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \ output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \ outform.h pptok.h preproc.h regs.h output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \ - outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \ - outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \ outform.h pptok.h preproc.h regs.h output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \ diff --git a/Mkfiles/netware.mak b/Mkfiles/netware.mak index d775070..692206f 100644 --- a/Mkfiles/netware.mak +++ b/Mkfiles/netware.mak @@ -172,9 +172,9 @@ outcoff.o: outcoff.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \ outdbg.o: outdbg.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \ pptok.h preproc.h regs.h outelf32.o: outelf32.c compiler.h config.h insnsi.h nasm.h nasmlib.h \ - outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h outelf64.o: outelf64.c compiler.h config.h insnsi.h nasm.h nasmlib.h \ - outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h outieee.o: outieee.c compiler.h config.h insnsi.h nasm.h nasmlib.h outform.h \ pptok.h preproc.h regs.h outmacho.o: outmacho.c compiler.h config.h insnsi.h nasm.h nasmlib.h \ diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak index cebc0f0..5215159 100644 --- a/Mkfiles/openwcom.mak +++ b/Mkfiles/openwcom.mak @@ -262,9 +262,9 @@ output\outcoff.$(O): output\outcoff.c compiler.h insnsi.h nasm.h nasmlib.h & output\outdbg.$(O): output\outdbg.c compiler.h insnsi.h nasm.h nasmlib.h & outform.h pptok.h preproc.h regs.h output\outelf32.$(O): output\outelf32.c compiler.h insnsi.h nasm.h nasmlib.h & - outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h output\outelf64.$(O): output\outelf64.c compiler.h insnsi.h nasm.h nasmlib.h & - outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h output\outieee.$(O): output\outieee.c compiler.h insnsi.h nasm.h nasmlib.h & outform.h pptok.h preproc.h regs.h output\outmacho.$(O): output\outmacho.c compiler.h insnsi.h nasm.h nasmlib.h & diff --git a/Mkfiles/owlinux.mak b/Mkfiles/owlinux.mak index 94ca28d..be56653 100644 --- a/Mkfiles/owlinux.mak +++ b/Mkfiles/owlinux.mak @@ -272,9 +272,9 @@ output/outcoff.$(O): output/outcoff.c compiler.h insnsi.h nasm.h nasmlib.h \ output/outdbg.$(O): output/outdbg.c compiler.h insnsi.h nasm.h nasmlib.h \ outform.h pptok.h preproc.h regs.h output/outelf32.$(O): output/outelf32.c compiler.h insnsi.h nasm.h nasmlib.h \ - outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h output/outelf64.$(O): output/outelf64.c compiler.h insnsi.h nasm.h nasmlib.h \ - outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h + outform.h outlib.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h output/outieee.$(O): output/outieee.c compiler.h insnsi.h nasm.h nasmlib.h \ outform.h pptok.h preproc.h regs.h output/outmacho.$(O): output/outmacho.c compiler.h insnsi.h nasm.h nasmlib.h \ diff --git a/output/outelf32.c b/output/outelf32.c index f5a7d20..0f9ba10 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -22,6 +22,7 @@ #include "stdscan.h" #include "outform.h" #include "outlib.h" +#include "rbtree.h" #ifdef OF_ELF32 @@ -57,16 +58,15 @@ struct Reloc { }; struct Symbol { - int32_t strpos; /* string table position of name */ - int32_t section; /* section ID of the symbol */ - int type; /* symbol type */ - int other; /* symbol visibility */ - int32_t value; /* address, or COMMON variable align */ - int32_t size; /* size of symbol */ - int32_t globnum; /* symbol table offset if global */ - struct Symbol *next; /* list of globals in each section */ - struct Symbol *nextfwd; /* list of unresolved-size symbols */ - char *name; /* used temporarily if in above list */ + struct rbtree symv; /* symbol value and symbol rbtree */ + int32_t strpos; /* string table position of name */ + int32_t section; /* section ID of the symbol */ + int type; /* symbol type */ + int other; /* symbol visibility */ + int32_t size; /* size of symbol */ + int32_t globnum; /* symbol table offset if global */ + struct Symbol *nextfwd; /* list of unresolved-size symbols */ + char *name; /* used temporarily if in above list */ }; #define SHT_PROGBITS 1 @@ -83,12 +83,12 @@ struct Section { int32_t index; int type; /* SHT_PROGBITS or SHT_NOBITS */ int align; /* alignment: power of two */ - uint32_t flags; /* section flags */ + uint32_t flags; /* section flags */ char *name; struct SAA *rel; int32_t rellen; struct Reloc *head, **tail; - struct Symbol *gsyms; /* global symbols in section */ + struct rbtree *gsyms; /* global symbols in section */ }; #define SECT_DELTA 32 @@ -629,7 +629,7 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, if (is_global == 2) { sym->size = offset; - sym->value = 0; + sym->symv.key = 0; sym->section = SHN_COMMON; /* * We have a common variable. Check the special text to see @@ -638,17 +638,18 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, */ if (special) { bool err; - sym->value = readnum(special, &err); + sym->symv.key = readnum(special, &err); if (err) error(ERR_NONFATAL, "alignment constraint `%s' is not a" " valid number", special); - else if ((sym->value | (sym->value - 1)) != 2 * sym->value - 1) + else if ((sym->symv.key | (sym->symv.key - 1)) + != 2 * sym->symv.key - 1) error(ERR_NONFATAL, "alignment constraint `%s' is not a" " power of two", special); } special_used = true; } else - sym->value = (sym->section == SHN_UNDEF ? 0 : offset); + sym->symv.key = (sym->section == SHN_UNDEF ? 0 : offset); if (sym->type == SYM_GLOBAL) { /* @@ -665,16 +666,14 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, bsym = raa_write(bsym, segment, nglobs); } else if (sym->section != SHN_ABS) { /* - * This is a global symbol; so we must add it to the linked - * list of global symbols in its section. We'll push it on - * the beginning of the list, because it doesn't matter - * much which end we put it on and it's easier like this. + * This is a global symbol; so we must add it to the rbtree + * of global symbols in its section. * * In addition, we check the special text for symbol * type and size information. */ - sym->next = sects[sym->section - 1]->gsyms; - sects[sym->section - 1]->gsyms = sym; + sects[sym->section-1]->gsyms = + rb_insert(sects[sym->section-1]->gsyms, &sym->symv); if (special) { int n = strcspn(special, " \t"); @@ -805,12 +804,13 @@ static void elf_add_reloc(struct Section *sect, int32_t segment, int type) * isn't even necessarily sorted. */ static int32_t elf_add_gsym_reloc(struct Section *sect, - int32_t segment, int32_t offset, + int32_t segment, uint32_t offset, int type, bool exact) { struct Reloc *r; struct Section *s; - struct Symbol *sym, *sm; + struct Symbol *sym; + struct rbtree *srb; int i; /* @@ -835,27 +835,13 @@ static int32_t elf_add_gsym_reloc(struct Section *sect, return offset; } - if (exact) { - /* - * Find a symbol pointing _exactly_ at this one. - */ - for (sym = s->gsyms; sym; sym = sym->next) - if (sym->value == offset) - break; - } else { - /* - * Find the nearest symbol below this one. - */ - sym = NULL; - for (sm = s->gsyms; sm; sm = sm->next) - if (sm->value <= offset && (!sym || sm->value > sym->value)) - sym = sm; - } - if (!sym && exact) { - error(ERR_NONFATAL, "unable to find a suitable global symbol" - " for this reference"); - return 0; + srb = rb_search(s->gsyms, offset); + if (!srb || (exact && srb->key != offset)) { + error(ERR_NONFATAL, "unable to find a suitable global symbol" + " for this reference"); + return 0; } + sym = container_of(srb, struct Symbol, symv); r = *sect->tail = nasm_malloc(sizeof(struct Reloc)); sect->tail = &r->next; @@ -867,7 +853,7 @@ static int32_t elf_add_gsym_reloc(struct Section *sect, sect->nrelocs++; - return offset - sym->value; + return offset - sym->symv.key; } static void elf_out(int32_t segto, const void *data, @@ -1311,7 +1297,7 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local) continue; p = entry; WRITELONG(p, sym->strpos); - WRITELONG(p, sym->value); + WRITELONG(p, sym->symv.key); WRITELONG(p, sym->size); WRITECHAR(p, sym->type); /* type and binding */ WRITECHAR(p, sym->other); /* visibility */ @@ -1367,7 +1353,7 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local) continue; p = entry; WRITELONG(p, sym->strpos); - WRITELONG(p, sym->value); + WRITELONG(p, sym->symv.key); WRITELONG(p, sym->size); WRITECHAR(p, sym->type); /* type and binding */ WRITECHAR(p, sym->other); /* visibility */ diff --git a/output/outelf64.c b/output/outelf64.c index 4254585..259d7d5 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -21,6 +21,7 @@ #include "stdscan.h" #include "outform.h" #include "outlib.h" +#include "rbtree.h" /* Definitions in lieu of elf.h */ #define SHT_NULL 0 /* Inactive section header */ @@ -141,19 +142,17 @@ struct Reloc { }; struct Symbol { + struct rbtree symv; /* symbol value and rbtree of globals */ int32_t strpos; /* string table position of name */ int32_t section; /* section ID of the symbol */ int type; /* symbol type */ int other; /* symbol visibility */ - int64_t value; /* address, or COMMON variable align */ int32_t size; /* size of symbol */ int32_t globnum; /* symbol table offset if global */ - struct Symbol *next; /* list of globals in each section */ struct Symbol *nextfwd; /* list of unresolved-size symbols */ char *name; /* used temporarily if in above list */ }; - struct Section { struct SAA *data; uint64_t len, size; @@ -166,7 +165,7 @@ struct Section { struct SAA *rel; uint64_t rellen; struct Reloc *head, **tail; - struct Symbol *gsyms; /* global symbols in section */ + struct rbtree *gsyms; /* global symbols in section */ }; #define SECT_DELTA 32 @@ -666,7 +665,7 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, if (is_global == 2) { sym->size = offset; - sym->value = 0; + sym->symv.key = 0; sym->section = SHN_COMMON; /* * We have a common variable. Check the special text to see @@ -675,17 +674,18 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, */ if (special) { bool err; - sym->value = readnum(special, &err); + sym->symv.key = readnum(special, &err); if (err) error(ERR_NONFATAL, "alignment constraint `%s' is not a" " valid number", special); - else if ((sym->value | (sym->value - 1)) != 2 * sym->value - 1) + else if ((sym->symv.key | (sym->symv.key - 1)) + != 2 * sym->symv.key - 1) error(ERR_NONFATAL, "alignment constraint `%s' is not a" " power of two", special); } special_used = true; } else - sym->value = (sym->section == SHN_UNDEF ? 0 : offset); + sym->symv.key = (sym->section == SHN_UNDEF ? 0 : offset); if (sym->type == SYM_GLOBAL) { /* @@ -702,16 +702,14 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, bsym = raa_write(bsym, segment, nglobs); } else if (sym->section != SHN_ABS) { /* - * This is a global symbol; so we must add it to the linked - * list of global symbols in its section. We'll push it on - * the beginning of the list, because it doesn't matter - * much which end we put it on and it's easier like this. + * This is a global symbol; so we must add it to the rbtree + * of global symbols in its section. * * In addition, we check the special text for symbol * type and size information. */ - sym->next = sects[sym->section - 1]->gsyms; - sects[sym->section - 1]->gsyms = sym; + sects[sym->section-1]->gsyms = + rb_insert(sects[sym->section-1]->gsyms, &sym->symv); if (special) { int n = strcspn(special, " \t"); @@ -843,12 +841,13 @@ static void elf_add_reloc(struct Section *sect, int32_t segment, * isn't even necessarily sorted. */ static void elf_add_gsym_reloc(struct Section *sect, - int32_t segment, int64_t offset, int64_t pcrel, + int32_t segment, uint64_t offset, int64_t pcrel, int type, bool exact) { struct Reloc *r; struct Section *s; - struct Symbol *sym, *sm; + struct Symbol *sym; + struct rbtree *srb; int i; /* @@ -873,34 +872,20 @@ static void elf_add_gsym_reloc(struct Section *sect, return; } - if (exact) { - /* - * Find a symbol pointing _exactly_ at this one. - */ - for (sym = s->gsyms; sym; sym = sym->next) - if (sym->value == offset) - break; - if (!sym) { - error(ERR_NONFATAL, "unable to find a suitable global symbol" - " for this reference"); - return; - } - } else { - /* - * Find the nearest symbol below this one. - */ - sym = NULL; - for (sm = s->gsyms; sm; sm = sm->next) - if (sm->value <= offset && (!sym || sm->value > sym->value)) - sym = sm; + srb = rb_search(s->gsyms, offset); + if (!srb || (exact && srb->key != offset)) { + error(ERR_NONFATAL, "unable to find a suitable global symbol" + " for this reference"); + return; } + sym = container_of(srb, struct Symbol, symv); r = *sect->tail = nasm_malloc(sizeof(struct Reloc)); sect->tail = &r->next; r->next = NULL; r->address = sect->len; - r->offset = offset - pcrel - sym->value; + r->offset = offset - pcrel - sym->symv.key; r->symbol = GLOBAL_TEMP_BASE + sym->globnum; r->type = type; @@ -1432,7 +1417,7 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local) WRITECHAR(p, sym->type); /* type and binding */ WRITECHAR(p, sym->other); /* visibility */ WRITESHORT(p, sym->section); /* index into section header table */ - WRITEDLONG(p, (int64_t)sym->value); /* value of symbol */ + WRITEDLONG(p, (int64_t)sym->symv.key); /* value of symbol */ WRITEDLONG(p, (int64_t)sym->size); /* size of symbol */ saa_wbytes(s, entry, 24L); *len += 24; @@ -1487,7 +1472,7 @@ static struct SAA *elf_build_symtab(int32_t *len, int32_t *local) WRITECHAR(p, sym->type); /* type and binding */ WRITECHAR(p, sym->other); /* visibility */ WRITESHORT(p, sym->section); - WRITEDLONG(p, (int64_t)sym->value); + WRITEDLONG(p, (int64_t)sym->symv.key); WRITEDLONG(p, (int64_t)sym->size); saa_wbytes(s, entry, 24L); *len += 24; -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-07 03:57:24
|
Date: Thu, 6 Nov 2008 19:54:05 -0800 Having the search argument and result be "const" is nice in theory, but causes problems in practice. Signed-off-by: H. Peter Anvin <hpa@...> --- rbtree.c | 4 ++-- rbtree.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rbtree.c b/rbtree.c index 7e13bff..618b4f8 100644 --- a/rbtree.c +++ b/rbtree.c @@ -12,9 +12,9 @@ #include "rbtree.h" -const struct rbtree *rb_search(const struct rbtree *tree, uint64_t key) +struct rbtree *rb_search(struct rbtree *tree, uint64_t key) { - const struct rbtree *best = NULL; + struct rbtree *best = NULL; while (tree) { if (tree->key == key) diff --git a/rbtree.h b/rbtree.h index d24daf3..e6d5c82 100644 --- a/rbtree.h +++ b/rbtree.h @@ -14,6 +14,6 @@ struct rbtree { }; struct rbtree *rb_insert(struct rbtree *, struct rbtree *); -const struct rbtree *rb_search(const struct rbtree *, uint64_t); +struct rbtree *rb_search(struct rbtree *, uint64_t); #endif /* NASM_RBTREE_H */ -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-06 17:45:19
|
Date: Thu, 6 Nov 2008 09:42:11 -0800 Add POPCNT fix to release notes. Signed-off-by: H. Peter Anvin <hpa@...> --- doc/changes.src | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/doc/changes.src b/doc/changes.src index f718a94..0a44844 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -21,6 +21,8 @@ since 2007. \b Fix crash on \c{%ifmacro} without an argument. +\b Correct the arguments to the \c{POPCNT} instruction. + \S{cl-2.05.01} Version 2.05.01 -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-06 17:42:53
|
Date: Thu, 6 Nov 2008 09:40:39 -0800 Very simple test of POPCNT instructions. Signed-off-by: H. Peter Anvin <hpa@...> --- test/popcnt.asm | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) create mode 100644 test/popcnt.asm diff --git a/test/popcnt.asm b/test/popcnt.asm new file mode 100644 index 0000000..0009619 --- /dev/null +++ b/test/popcnt.asm @@ -0,0 +1,32 @@ +;Testname=test; Arguments=-fbin -opopcnt.bin; Files=stdout stderr popcnt.bin + + bits 16 + + popcnt ax,cx + popcnt ax,[si] + popcnt ax,word [si] + popcnt eax,ecx + popcnt eax,[si] + popcnt eax,dword [si] + + bits 32 + + popcnt ax,cx + popcnt ax,[esi] + popcnt ax,word [esi] + popcnt eax,ecx + popcnt eax,[esi] + popcnt eax,dword [esi] + + bits 64 + + popcnt ax,cx + popcnt ax,[rsi] + popcnt ax,word [rsi] + popcnt eax,ecx + popcnt eax,[rsi] + popcnt eax,dword [rsi] + popcnt rax,rcx + popcnt rax,[rsi] + popcnt rax,qword [rsi] + \ No newline at end of file -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-06 17:42:45
|
Date: Thu, 6 Nov 2008 09:39:48 -0800 The POPCNT instruction should not require sizes on memory operands. Add the appropriate size flags for that to work. Signed-off-by: H. Peter Anvin <hpa@...> --- insns.dat | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/insns.dat b/insns.dat index 4a89615..8119043 100644 --- a/insns.dat +++ b/insns.dat @@ -1854,9 +1854,9 @@ PCMPESTRM xmmreg,xmmrm,imm \361\3\x0F\x3A\x60\110\26 SSE42 PCMPISTRI xmmreg,xmmrm,imm \361\3\x0F\x3A\x63\110\26 SSE42 PCMPISTRM xmmreg,xmmrm,imm \361\3\x0F\x3A\x62\110\26 SSE42 PCMPGTQ xmmreg,xmmrm \361\3\x0F\x38\x37\110 SSE42 -POPCNT reg16,rm16 \320\363\2\x0F\xB8\110 NEHALEM -POPCNT reg32,rm32 \321\363\2\x0F\xB8\110 NEHALEM -POPCNT reg64,rm64 \324\363\2\x0F\xB8\110 NEHALEM,X64 +POPCNT reg16,rm16 \320\363\2\x0F\xB8\110 NEHALEM,SW +POPCNT reg32,rm32 \321\363\2\x0F\xB8\110 NEHALEM,SD +POPCNT reg64,rm64 \324\363\2\x0F\xB8\110 NEHALEM,SQ,X64 ;# AMD SSE5 instructions -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-06 17:42:35
|
Date: Thu, 6 Nov 2008 09:35:02 -0800 The 64-bit version of the POPCNT instruction takes r64,rm64; not r64,rm32. Signed-off-by: H. Peter Anvin <hpa@...> --- insns.dat | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/insns.dat b/insns.dat index a863f64..4a89615 100644 --- a/insns.dat +++ b/insns.dat @@ -1856,7 +1856,7 @@ PCMPISTRM xmmreg,xmmrm,imm \361\3\x0F\x3A\x62\110\26 SSE42 PCMPGTQ xmmreg,xmmrm \361\3\x0F\x38\x37\110 SSE42 POPCNT reg16,rm16 \320\363\2\x0F\xB8\110 NEHALEM POPCNT reg32,rm32 \321\363\2\x0F\xB8\110 NEHALEM -POPCNT reg64,rm32 \324\363\2\x0F\xB8\110 NEHALEM,X64 +POPCNT reg64,rm64 \324\363\2\x0F\xB8\110 NEHALEM,X64 ;# AMD SSE5 instructions -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-06 17:42:32
|
Date: Tue, 4 Nov 2008 14:24:34 -0800 BR 2222615: Fix segmentation fault on %ifmacro without an argument. Signed-off-by: H. Peter Anvin <hpa@...> --- preproc.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/preproc.c b/preproc.c index e5b5ab3..c899828 100644 --- a/preproc.c +++ b/preproc.c @@ -1584,7 +1584,6 @@ static bool if_condition(Token * tline, enum preproc_token ct) bool found = false; MMacro searching, *mmac; - tline = tline->next; skip_white_(tline); tline = expand_id(tline); if (!tok_type_(tline, TOK_ID)) { -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-05 23:57:25
|
Date: Wed, 5 Nov 2008 15:55:40 -0800 The implication that %line allows NASM to digest cpp output is just plain wrong, at least without additional intermediate processing. Be a little more circumspect. Signed-off-by: H. Peter Anvin <hpa@...> --- doc/nasmdoc.src | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 14ec2c1..22fcc7c 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -3491,11 +3491,8 @@ the user. For example: NASM also has preprocessor directives which allow access to information from external sources. Currently they include: -The following preprocessor directive is supported to allow NASM to -correctly handle output of the cpp C language preprocessor. - -\b\c{%line} enables NASM to correctly handle the output of the cpp -C language preprocessor (see \k{line}). +\b\c{%line} enables NASM to correctly handle the output of another +preprocessor (see \k{line}). \b\c{%!} enables NASM to read in the value of an environment variable, which can then be used in your program (see \k{getenv}). -- 1.6.0.2 |
From: Victor van den Elzen <victor.vde@gm...> - 2008-11-05 13:27:29
|
Date: Wed, 5 Nov 2008 14:11:46 +0100 nasm.c should respect the default debug format of the output format, instead of replacing it with the first format in the list. This is cleaner and allows the list to be sorted normally. This commit rewrites commit 116994111b which was very fragile. --- nasm.c | 2 -- output/outdbg.c | 2 +- output/outelf32.c | 17 +++++++++++------ output/outelf64.c | 4 ++-- output/outieee.c | 2 +- output/outobj.c | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/nasm.c b/nasm.c index 56109e1..7d002d3 100644 --- a/nasm.c +++ b/nasm.c @@ -632,8 +632,6 @@ static bool process_arg(char *p, char *q) report_error(ERR_FATAL | ERR_NOFILE | ERR_USAGE, "unrecognised output format `%s' - " "use -hf for a list", param); - } else { - ofmt->current_dfmt = ofmt->debug_formats[0]; } break; diff --git a/output/outdbg.c b/output/outdbg.c index 1646b4b..2007355 100644 --- a/output/outdbg.c +++ b/output/outdbg.c @@ -231,7 +231,7 @@ struct ofmt of_dbg = { "dbg", NULL, debug_debug_arr, - &null_debug_form, + &debug_debug_form, NULL, dbg_init, dbg_set_info, diff --git a/output/outelf32.c b/output/outelf32.c index 7a7a904..f5a7d20 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -299,8 +299,6 @@ static int32_t elf_sym_sect, elf_tlsie_sect; static void elf_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval) { - if (of_elf.current_dfmt != &null_debug_form) - of_elf32.current_dfmt = of_elf.current_dfmt; elffp = fp; error = errfunc; evaluate = eval; @@ -342,6 +340,13 @@ static void elf_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval) def_seg = seg_alloc(); } +static void elf_init_hack(FILE * fp, efunc errfunc, ldfunc ldef, + evalfunc eval) +{ + of_elf32.current_dfmt = of_elf.current_dfmt; /* Sync debugging format */ + elf_init(fp, errfunc, ldef, eval); +} + static void elf_cleanup(int debuginfo) { struct Reloc *r; @@ -1533,14 +1538,14 @@ static struct dfmt df_stabs = { stabs32_cleanup }; -struct dfmt *elf32_debugs_arr[3] = { &df_stabs, &df_dwarf, NULL }; +struct dfmt *elf32_debugs_arr[3] = { &df_dwarf, &df_stabs, NULL }; struct ofmt of_elf32 = { "ELF32 (i386) object files (e.g. Linux)", "elf32", NULL, elf32_debugs_arr, - &null_debug_form, + &df_stabs, elf_stdmac, elf_init, elf_set_info, @@ -1558,9 +1563,9 @@ struct ofmt of_elf = { "elf", NULL, elf32_debugs_arr, - &null_debug_form, + &df_stabs, elf_stdmac, - elf_init, + elf_init_hack, elf_set_info, elf_out, elf_deflabel, diff --git a/output/outelf64.c b/output/outelf64.c index 4e2988a..4254585 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -1659,14 +1659,14 @@ static struct dfmt df_stabs = { stabs64_cleanup }; -struct dfmt *elf64_debugs_arr[3] = { &df_stabs, &df_dwarf, NULL }; +struct dfmt *elf64_debugs_arr[3] = { &df_dwarf, &df_stabs, NULL }; struct ofmt of_elf64 = { "ELF64 (x86_64) object files (e.g. Linux)", "elf64", NULL, elf64_debugs_arr, - &null_debug_form, + &df_stabs, elf_stdmac, elf_init, elf_set_info, diff --git a/output/outieee.c b/output/outieee.c index 36d0a67..74c1fc8 100644 --- a/output/outieee.c +++ b/output/outieee.c @@ -1473,7 +1473,7 @@ struct ofmt of_ieee = { "ieee", NULL, ladsoft_debug_arr, - &null_debug_form, + &ladsoft_debug_form, NULL, ieee_init, ieee_set_info, diff --git a/output/outobj.c b/output/outobj.c index 5a72724..f51dcd1 100644 --- a/output/outobj.c +++ b/output/outobj.c @@ -2524,7 +2524,7 @@ struct ofmt of_obj = { "obj", NULL, borland_debug_arr, - &null_debug_form, + &borland_debug_form, obj_stdmac, obj_init, obj_set_info, -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-04 22:27:45
|
Date: Tue, 4 Nov 2008 14:26:32 -0800 Document fixed %ifmacro. Signed-off-by: H. Peter Anvin <hpa@...> --- doc/changes.src | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/doc/changes.src b/doc/changes.src index 2d8b850..f718a94 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -19,6 +19,8 @@ since 2007. \b Support for thread-local storage in ELF32 and ELF64. See \k{elftls}. +\b Fix crash on \c{%ifmacro} without an argument. + \S{cl-2.05.01} Version 2.05.01 -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-04 22:27:35
|
Date: Tue, 4 Nov 2008 14:25:12 -0800 Add a test for %ifmacro, per BR 2222615. Signed-off-by: H. Peter Anvin <hpa@...> --- test/br2222615.asm | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) create mode 100644 test/br2222615.asm diff --git a/test/br2222615.asm b/test/br2222615.asm new file mode 100644 index 0000000..7acef6c --- /dev/null +++ b/test/br2222615.asm @@ -0,0 +1,19 @@ +;Testname=noerror; Arguments=-fbin -obr2222615.bin; Files=stdout stderr br2222615.bin +;Testname=error; Arguments=-DERROR -fbin -obr2222615.bin; Files=stdout stderr br2222615.bin + +%macro bluttan 0 + nop +%endmacro + +%ifnmacro bluttan + %error "bluttan is a macro" +%endif + +%ifmacro blej + %error "blej is not a macro" +%endif + +%ifdef ERROR + %ifnmacro + %endif +%endif -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-04 22:27:27
|
Date: Tue, 4 Nov 2008 14:24:34 -0800 BR 2222615: Fix segmentation fault on %ifmacro without an argument. Signed-off-by: H. Peter Anvin <hpa@...> --- preproc.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/preproc.c b/preproc.c index 350b293..c6dd1b7 100644 --- a/preproc.c +++ b/preproc.c @@ -1613,7 +1613,6 @@ static bool if_condition(Token * tline, enum preproc_token ct) bool found = false; MMacro searching, *mmac; - tline = tline->next; skip_white_(tline); tline = expand_id(tline); if (!tok_type_(tline, TOK_ID)) { -- 1.6.0.2 |
From: Charles Crayne <chuck@th...> - 2008-11-04 02:24:16
|
Date: Mon, 3 Nov 2008 18:21:24 -0800 Specifically check for end of final pass. --- nasm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/nasm.c b/nasm.c index ab369b8..56109e1 100644 --- a/nasm.c +++ b/nasm.c @@ -1719,7 +1719,7 @@ static void assemble_file(char *fname, StrList **depend_ptr) exit(1); } - if (passn > 1 && !global_offset_changed) + if ((passn > 1 && !global_offset_changed) || pass0 == 2) pass0++; else if (global_offset_changed && global_offset_changed < prev_offset_changed) { prev_offset_changed = global_offset_changed; -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-03 04:42:32
|
Date: Sun, 2 Nov 2008 20:41:29 -0800 Add ELF TLS to the release notes. Signed-off-by: H. Peter Anvin <hpa@...> --- doc/changes.src | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/doc/changes.src b/doc/changes.src index 02446df..2d8b850 100644 --- a/doc/changes.src +++ b/doc/changes.src @@ -17,6 +17,8 @@ since 2007. \b The argument to \c{%use} is no longer macro-expanded. Use \c{%[...]} if macro expansion is desired. +\b Support for thread-local storage in ELF32 and ELF64. See \k{elftls}. + \S{cl-2.05.01} Version 2.05.01 -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-03 04:42:29
|
Date: Sun, 2 Nov 2008 20:40:16 -0800 Minimize the TLS documentation examples (we don't need "dword" in a mov from ebx, for example.) This is just to avoid user confusion. Signed-off-by: H. Peter Anvin <hpa@...> --- doc/nasmdoc.src | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index a79a318..14ec2c1 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -5404,7 +5404,7 @@ offset of the symbol within the TLS block, so you can access the value of the symbol with code such as: \c mov eax,[tid wrt ..tlsie] -\c mov dword [gs:eax],ebx +\c mov [gs:eax],ebx \b In ELF64 mode, referring to an external or global symbol using @@ -5414,7 +5414,7 @@ offset of the symbol within the TLS block, so you can access the value of the symbol with code such as: \c mov rax,[rel tid wrt ..gottpoff] -\c mov rcx, [fs:rax] +\c mov rcx,[fs:rax] \S{elfglob} \c{elf} Extensions to the \c{GLOBAL} Directive\I{GLOBAL, -- 1.6.0.2 |
From: Charles Crayne <chuck@th...> - 2008-11-02 00:18:25
|
Date: Sat, 1 Nov 2008 17:09:36 -0700 Absolute relocation wrt ..tlsie for ELF32 Relative relocation wrt ..gottpoff for ELF64 --- doc/nasmdoc.src | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 35ba19b..a79a318 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -5397,9 +5397,18 @@ shared libraries entirely in NASM is given in \k{picdll}. \S{elftls} \i{Thread Local Storage}\I{TLS}: \c{elf} Special Symbols and \i\c{WRT} +\b In ELF32 mode, referring to an external or global symbol using +\c{wrt ..tlsie} \I\c{..tlsie} +causes the linker to build an entry \e{in} the GOT containing the +offset of the symbol within the TLS block, so you can access the value +of the symbol with code such as: + +\c mov eax,[tid wrt ..tlsie] +\c mov dword [gs:eax],ebx -\b Referring to an external or global symbol using \c{wrt ..gottpoff} \I\c{..gottpoff} +\b In ELF64 mode, referring to an external or global symbol using +\c{wrt ..gottpoff} \I\c{..gottpoff} causes the linker to build an entry \e{in} the GOT containing the offset of the symbol within the TLS block, so you can access the value of the symbol with code such as: @@ -5407,7 +5416,6 @@ of the symbol with code such as: \c mov rax,[rel tid wrt ..gottpoff] \c mov rcx, [fs:rax] -(Please note that this feature is currently implemented only for ELF64.) \S{elfglob} \c{elf} Extensions to the \c{GLOBAL} Directive\I{GLOBAL, elf extensions to}\I{GLOBAL, aoutb extensions to} -- 1.6.0.2 |
From: Charles Crayne <chuck@th...> - 2008-11-01 23:54:23
|
Date: Sat, 1 Nov 2008 16:48:31 -0700 Add new WRT type ..tlsie. Generate R_386_TLS_IE relocation entries for references to thread local variables. --- output/outelf32.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 93af47d..7a7a904 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -39,6 +39,9 @@ enum reloc_type { R_386_RELATIVE = 8, /* ??? */ R_386_GOTOFF = 9, /* an offset from GOT base */ R_386_GOTPC = 10, /* a PC-relative offset _to_ GOT */ + R_386_TLS_TPOFF = 14, /* Offset in static TLS block */ + R_386_TLS_IE = 15, /* Address of GOT entry for static TLS + block offset */ /* These are GNU extensions, but useful */ R_386_16 = 20, /* A 16-bit absolute relocation */ R_386_PC16 = 21, /* A 16-bit PC-relative relocation */ @@ -287,12 +290,12 @@ void saa_wleb128s(struct SAA *, int); /* * Special section numbers which are used to define ELF special - * symbols, which can be used with WRT to provide PIC relocation - * types. + * symbols, which can be used with WRT to provide PIC and TLS + * relocation types. */ 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_sym_sect, elf_tlsie_sect; static void elf_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval) { @@ -332,6 +335,9 @@ static void elf_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval) elf_sym_sect = seg_alloc(); ldef("..sym", elf_sym_sect + 1, 0L, NULL, false, false, &of_elf32, error); + elf_tlsie_sect = seg_alloc(); + ldef("..tlsie", elf_tlsie_sect + 1, 0L, NULL, false, false, &of_elf32, + error); def_seg = seg_alloc(); } @@ -544,7 +550,7 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset, */ if (strcmp(name, "..gotpc") && strcmp(name, "..gotoff") && strcmp(name, "..got") && strcmp(name, "..plt") && - strcmp(name, "..sym")) + strcmp(name, "..sym") && strcmp(name, "..tlsie")) error(ERR_NONFATAL, "unrecognised special symbol `%s'", name); return; } @@ -947,6 +953,9 @@ static void elf_out(int32_t segto, const void *data, elf_add_reloc(s, segment, R_386_GOTPC); } else if (wrt == elf_gotoff_sect + 1) { elf_add_reloc(s, segment, R_386_GOTOFF); + } else if (wrt == elf_tlsie_sect + 1) { + addr = elf_add_gsym_reloc(s, segment, addr, + R_386_TLS_IE, true); } else if (wrt == elf_got_sect + 1) { addr = elf_add_gsym_reloc(s, segment, addr, R_386_GOT32, true); -- 1.6.0.2 |
From: H. Peter Anvin <hpa@zy...> - 2008-11-01 20:03:22
|
Date: Sat, 1 Nov 2008 12:57:05 -0700 Snapshot releases have *only* digits in the tail. "git describe" produces tails that have digits in them, but aren't numeric. Signed-off-by: H. Peter Anvin <hpa@...> --- version.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/version.pl b/version.pl index f8088f5..82aa883 100755 --- a/version.pl +++ b/version.pl @@ -60,7 +60,7 @@ if ( $line =~ /^([0-9]+)\.([0-9]+)(.*)$/ ) { die "$0: Invalid input format\n"; } -if ($tail =~ /^\-([0-9]+)/) { +if ($tail =~ /^\-([0-9]+)$/) { $snapshot = $1; } else { undef $snapshot; -- 1.6.0.2 |