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: H. P. A. <hp...@zy...> - 2016-03-04 02:21:04
|
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 |
From: H. P. A. <hp...@zy...> - 2016-03-04 02:19:31
|
We urgently need help tracking down two new critical bugs reported by the same user, Bruce Cran: http://bugzilla.nasm.us/show_bug.cgi?id=3392342 http://bugzilla.nasm.us/show_bug.cgi?id=3392343 One is possibly related to Codeview support, but could also be a general problem. The other is related to the preprocessor. Both I would classify as critical. -hpa |
From: H. P. A. <hp...@zy...> - 2016-02-27 08:09:21
|
On 02/26/16 23:50, H. Peter Anvin wrote: >> >> I cannot reproduce this with gcc 5.3.1 or clang 3.5 on Fedora. It >> would >> be highly useful if you could: >> >> a) configure with --enable-werror >> b) make sure you do "make clean" between trying compilers >> c) try compiling with -O0 >> d) try changing uint64_t on line 311 of assemble.c to int64_t >> >> The most logical explanation is that the compiler miscompiles >> abs((int)size) where size is uint64_t. However, this is certainly not >> true for all the three compilers listed. >> >> If we can narrow this down to a specific compiler it might be >> worthwhile >> to make a bug report. >> >> -hpa > > > One more thing: try adding the -fwrap option to see if that fixes the > problem, especially if the problem goes away with -O0. > That should have been -fwrapv. -hpa |
From: H. P. A. <hp...@zy...> - 2016-02-27 07:50:49
|
On February 26, 2016 11:34:22 PM PST, "H. Peter Anvin" <hp...@zy...> wrote: >On 02/24/16 05:30, Ismail Donmez wrote: >> H. Peter Anvin <hpa <at> zytor.com> writes: >> >>> >>> I have just tagged NASM 2.12rc3. I am hoping this is the final rc >>> before a 2.12 release. >>> >>> If you can, please test it out as I would like to make a final 2.12 >>> release as soon as possible. >> >> This might be too late to report this (I originally reported at >> forum.nasm.us but with no reply) but with nams.git and 2.12rc7 all >tests >> fail for me on openSUSE Tumbleweed x86-64, here is one example: >> >> ? gdb --args ../nasm -fbin -ovmread.bin vmread.asm >> Reading symbols from ../nasm...done. >> (gdb) r >> Starting program: /havana/t/n/nasm/nasm -fbin -ovmread.bin vmread.asm >> >> Program received signal SIGSEGV, Segmentation fault. >> __memcpy_sse2_unaligned () at >../sysdeps/x86_64/multiarch/memcpy-sse2- >> unaligned.S:36 >> 36 ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such >file >> or directory. >> (gdb) bt >> #0 __memcpy_sse2_unaligned () at >../sysdeps/x86_64/multiarch/memcpy-sse2- >> unaligned.S:36 >> #1 0x0000000000407915 in saa_wbytes (s=0x7a5db0, >data=0x7ffd96f364d0, >> len=18446744073709551612) at saa.c:132 >> #2 0x0000000000416b30 in bin_out (segto=2, data=0x7ffd96f364d0, >> type=OUT_RAWDATA, size=18446744073709551612, segment=-1, wrt=-1) at >> output/outbin.c:797 >> #3 0x000000000040a8f6 in out (offset=32, segto=2, >data=0x7ffd96f364d0, >> type=OUT_RAWDATA, size=18446744073709551612, segment=-1, wrt=-1) at >> assemble.c:372 >> #4 0x000000000040e4fc in gencode (segment=2, offset=32, bits=64, >> ins=0x7ffd96f367a0, temp=0x4bd9f0 <instrux_VMREAD+80>, insn_end=36) >at >> assemble.c:1945 >> #5 0x000000000040b436 in assemble (segment=2, offset=28, bits=64, >cp=..., >> instruction=0x7ffd96f367a0, output=0x51e660 <of_bin>, error=0x405fe6 >> <nasm_error>, listgen=0x51f7c0 <nasmlist>) at assemble.c:692 >> #6 0x00000000004054ad in assemble_file (fname=0x51f8c0 <inname> >> "vmread.asm", depend_ptr=0x0) at nasm.c:1761 >> #7 0x00000000004026c4 in main (argc=4, argv=0x7ffd96f36b48) at >nasm.c:466 >> >> Tried with gcc 5.3.1, gcc-6 trunk and clang 3.8. All gives the same >> problem. >> >> Any help is appreciated. >> > >I cannot reproduce this with gcc 5.3.1 or clang 3.5 on Fedora. It >would >be highly useful if you could: > >a) configure with --enable-werror >b) make sure you do "make clean" between trying compilers >c) try compiling with -O0 >d) try changing uint64_t on line 311 of assemble.c to int64_t > >The most logical explanation is that the compiler miscompiles >abs((int)size) where size is uint64_t. However, this is certainly not >true for all the three compilers listed. > >If we can narrow this down to a specific compiler it might be >worthwhile >to make a bug report. > > -hpa One more thing: try adding the -fwrap option to see if that fixes the problem, especially if the problem goes away with -O0. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. |
From: H. P. A. <hp...@zy...> - 2016-02-27 07:34:56
|
On 02/24/16 05:30, Ismail Donmez wrote: > H. Peter Anvin <hpa <at> zytor.com> writes: > >> >> I have just tagged NASM 2.12rc3. I am hoping this is the final rc >> before a 2.12 release. >> >> If you can, please test it out as I would like to make a final 2.12 >> release as soon as possible. > > This might be too late to report this (I originally reported at > forum.nasm.us but with no reply) but with nams.git and 2.12rc7 all tests > fail for me on openSUSE Tumbleweed x86-64, here is one example: > > ? gdb --args ../nasm -fbin -ovmread.bin vmread.asm > Reading symbols from ../nasm...done. > (gdb) r > Starting program: /havana/t/n/nasm/nasm -fbin -ovmread.bin vmread.asm > > Program received signal SIGSEGV, Segmentation fault. > __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2- > unaligned.S:36 > 36 ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file > or directory. > (gdb) bt > #0 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2- > unaligned.S:36 > #1 0x0000000000407915 in saa_wbytes (s=0x7a5db0, data=0x7ffd96f364d0, > len=18446744073709551612) at saa.c:132 > #2 0x0000000000416b30 in bin_out (segto=2, data=0x7ffd96f364d0, > type=OUT_RAWDATA, size=18446744073709551612, segment=-1, wrt=-1) at > output/outbin.c:797 > #3 0x000000000040a8f6 in out (offset=32, segto=2, data=0x7ffd96f364d0, > type=OUT_RAWDATA, size=18446744073709551612, segment=-1, wrt=-1) at > assemble.c:372 > #4 0x000000000040e4fc in gencode (segment=2, offset=32, bits=64, > ins=0x7ffd96f367a0, temp=0x4bd9f0 <instrux_VMREAD+80>, insn_end=36) at > assemble.c:1945 > #5 0x000000000040b436 in assemble (segment=2, offset=28, bits=64, cp=..., > instruction=0x7ffd96f367a0, output=0x51e660 <of_bin>, error=0x405fe6 > <nasm_error>, listgen=0x51f7c0 <nasmlist>) at assemble.c:692 > #6 0x00000000004054ad in assemble_file (fname=0x51f8c0 <inname> > "vmread.asm", depend_ptr=0x0) at nasm.c:1761 > #7 0x00000000004026c4 in main (argc=4, argv=0x7ffd96f36b48) at nasm.c:466 > > Tried with gcc 5.3.1, gcc-6 trunk and clang 3.8. All gives the same > problem. > > Any help is appreciated. > I cannot reproduce this with gcc 5.3.1 or clang 3.5 on Fedora. It would be highly useful if you could: a) configure with --enable-werror b) make sure you do "make clean" between trying compilers c) try compiling with -O0 d) try changing uint64_t on line 311 of assemble.c to int64_t The most logical explanation is that the compiler miscompiles abs((int)size) where size is uint64_t. However, this is certainly not true for all the three compilers listed. If we can narrow this down to a specific compiler it might be worthwhile to make a bug report. -hpa |
From: H. P. A. <hp...@zy...> - 2016-02-27 05:17:07
|
Hi all, I have tagged NASM 2.12 for release. For the developers, it now means "master" is a development branch; "nasm-2.12.xx" is the maintenance branch for this release. New in this release: (*) Major fixes to the `macho' backend (section 7.8); earlier versions would produce invalid symbols and relocations on a regular basis. (*) Support for thread-local storage in Mach-O. (*) Support for arbitrary sections in Mach-O. (*) Fix wrong negative size treated as a big positive value passed into backend causing NASM to crash. (*) Fix handling of zero-extending unsigned relocations, we have been printing wrong message and forgot to assign segment with predefined value before passing it into output format. (*) Fix potential write of oversized (with size greater than allowed in output format) relative relocations. (*) Portability fixes for building NASM with LLVM compiler. (*) Add support of Codeview version 8 (`cv8') debug format for `win32' and `win64' formats in the `COFF' backend, see section 7.5.3. (*) Allow 64-bit outputs in 16/32-bit only backends. Unsigned 64-bit relocations are zero-extended from 32-bits with a warning (suppressible via `-w-zext-reloc'); signed 64-bit relocations are an arror. (*) Line numbers in list files now correspond to the lines in the source files, instead of simply being sequential. (*) There is now an official 64-bit (x64 a.k.a. x86-64) build for Windows. |
From: Knut S. O. <bir...@an...> - 2016-02-24 13:53:39
|
Removes help text left behind when --allow-64-bit was turned into default behavior + warning. Signed-off-by: Knut St. Osmundsen <bir...@an...> --- nasm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/nasm.c b/nasm.c index a176f25..469cd51 100644 --- a/nasm.c +++ b/nasm.c @@ -805,9 +805,6 @@ static bool process_arg(char *p, char *q) "--prefix,--postfix\n" " this options prepend or append the given argument to all\n" " extern and global variables\n" - "--allow-64-bit\n" - " do not restrict 64-bit code to 64-bit capable output\n" - " formats (use with care, no complaining)\n\n" "Warnings:\n"); for (i = 0; i <= ERR_WARN_MAX; i++) printf(" %-23s %s (default %s)\n", -- 2.6.2.windows.1 |
From: Knut S. O. <bir...@an...> - 2016-02-24 13:47:55
|
Fixes Visual C++ 2010 breakage in recently added codeview 8 code. Signed-off-by: Knut St. Osmundsen <bir...@an...> --- md5.h | 2 +- output/codeview.c | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/md5.h b/md5.h index 147d3dd..ea34cda 100644 --- a/md5.h +++ b/md5.h @@ -1,7 +1,7 @@ #ifndef _MD5_H_ #define _MD5_H_ -#include <stdint.h> +#include <inttypes.h> #define MD5_HASHBYTES 16 diff --git a/output/codeview.c b/output/codeview.c index 2f5bb69..fa4e9d5 100644 --- a/output/codeview.c +++ b/output/codeview.c @@ -59,15 +59,15 @@ static void cv8_output(int type, void *param); static void cv8_cleanup(void); struct dfmt df_cv8 = { - .fullname = "Codeview 8", - .shortname = "cv8", - .init = cv8_init, - .linenum = cv8_linenum, - .debug_deflabel = cv8_deflabel, - .debug_directive = null_debug_directive, - .debug_typevalue = cv8_typevalue, - .debug_output = cv8_output, - .cleanup = cv8_cleanup, + /*.fullname =*/ "Codeview 8", + /*.shortname =*/ "cv8", + /*.init =*/ cv8_init, + /*.linenum =*/ cv8_linenum, + /*.debug_deflabel =*/ cv8_deflabel, + /*.debug_directive =*/ null_debug_directive, + /*.debug_typevalue =*/ cv8_typevalue, + /*.debug_output =*/ cv8_output, + /*.cleanup =*/ cv8_cleanup, }; /******************************************************************************* @@ -379,6 +379,8 @@ static void register_reloc(struct coff_Section *const sect, { struct coff_Reloc *r; struct coff_Section *sec; + int idx_sec; + uint32_t idx_sym; r = *sect->tail = nasm_malloc(sizeof(struct coff_Reloc)); sect->tail = &r->next; @@ -390,8 +392,8 @@ static void register_reloc(struct coff_Section *const sect, r->type = type; r->symbol = 0; - for (int i = 0; i < coff_nsects; i++) { - sec = coff_sects[i]; + for (idx_sec = 0; idx_sec < coff_nsects; idx_sec++) { + sec = coff_sects[idx_sec]; if (!strcmp(sym, sec->name)) { return; } @@ -399,7 +401,7 @@ static void register_reloc(struct coff_Section *const sect, } saa_rewind(coff_syms); - for (uint32_t i = 0; i < coff_nsyms; i++) { + for (idx_sym = 0; idx_sym < coff_nsyms; idx_sym++) { struct coff_Symbol *s = saa_rstruct(coff_syms); r->symbol++; if (s->strpos == -1 && !strcmp(sym, s->name)) { -- 2.6.2.windows.1 |
From: Ismail D. <is...@i1...> - 2016-02-24 13:35:23
|
H. Peter Anvin <hpa <at> zytor.com> writes: > > I have just tagged NASM 2.12rc3. I am hoping this is the final rc > before a 2.12 release. > > If you can, please test it out as I would like to make a final 2.12 > release as soon as possible. This might be too late to report this (I originally reported at forum.nasm.us but with no reply) but with nams.git and 2.12rc7 all tests fail for me on openSUSE Tumbleweed x86-64, here is one example: ? gdb --args ../nasm -fbin -ovmread.bin vmread.asm Reading symbols from ../nasm...done. (gdb) r Starting program: /havana/t/n/nasm/nasm -fbin -ovmread.bin vmread.asm Program received signal SIGSEGV, Segmentation fault. __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2- unaligned.S:36 36 ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file or directory. (gdb) bt #0 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2- unaligned.S:36 #1 0x0000000000407915 in saa_wbytes (s=0x7a5db0, data=0x7ffd96f364d0, len=18446744073709551612) at saa.c:132 #2 0x0000000000416b30 in bin_out (segto=2, data=0x7ffd96f364d0, type=OUT_RAWDATA, size=18446744073709551612, segment=-1, wrt=-1) at output/outbin.c:797 #3 0x000000000040a8f6 in out (offset=32, segto=2, data=0x7ffd96f364d0, type=OUT_RAWDATA, size=18446744073709551612, segment=-1, wrt=-1) at assemble.c:372 #4 0x000000000040e4fc in gencode (segment=2, offset=32, bits=64, ins=0x7ffd96f367a0, temp=0x4bd9f0 <instrux_VMREAD+80>, insn_end=36) at assemble.c:1945 #5 0x000000000040b436 in assemble (segment=2, offset=28, bits=64, cp=..., instruction=0x7ffd96f367a0, output=0x51e660 <of_bin>, error=0x405fe6 <nasm_error>, listgen=0x51f7c0 <nasmlist>) at assemble.c:692 #6 0x00000000004054ad in assemble_file (fname=0x51f8c0 <inname> "vmread.asm", depend_ptr=0x0) at nasm.c:1761 #7 0x00000000004026c4 in main (argc=4, argv=0x7ffd96f36b48) at nasm.c:466 Tried with gcc 5.3.1, gcc-6 trunk and clang 3.8. All gives the same problem. Any help is appreciated. Regards, ismail |
From: Cyrill G. <gor...@gm...> - 2016-02-13 07:45:11
|
On Fri, Feb 12, 2016 at 11:41:41PM -0800, H. Peter Anvin wrote: > I have just tagged NASM 2.12rc3. I am hoping this is the final rc > before a 2.12 release. > > If you can, please test it out as I would like to make a final 2.12 > release as soon as possible. This is an amaizing job, Peter! Thanks a huge! I ran nasm for ffmpeg on linux and mac and everything worked just fine! |
From: H. P. A. <hp...@zy...> - 2016-02-13 07:41:56
|
I have just tagged NASM 2.12rc3. I am hoping this is the final rc before a 2.12 release. If you can, please test it out as I would like to make a final 2.12 release as soon as possible. Thank you, -hpa |
From: Cyrill G. <gor...@gm...> - 2016-02-11 21:27:00
|
On Thu, Feb 11, 2016 at 01:22:29PM -0800, H. Peter Anvin wrote: > The latest version of the i386 and x86-64 EFI psABI define a new set of > relocations which allow for linker-side optimizations. gas generates > these automatically without requiring new syntax, and I would like for > NASM to follow suit (with a directive and/or command line to override, > of course.) However, I'm somewhat leery of squeezing this into the 2.12 > release, especially since a release is rather urgently needed (between > cv8 support and the necessary MachO fixes.) I believe as well that it might wait for 2.13 or something. |
From: H. P. A. <hp...@zy...> - 2016-02-11 21:23:05
|
The latest version of the i386 and x86-64 EFI psABI define a new set of relocations which allow for linker-side optimizations. gas generates these automatically without requiring new syntax, and I would like for NASM to follow suit (with a directive and/or command line to override, of course.) However, I'm somewhat leery of squeezing this into the 2.12 release, especially since a release is rather urgently needed (between cv8 support and the necessary MachO fixes.) Thus, I would like people's opinion on this. As part of this, I hope to do a rewrite of the backend interface to, among other things, remove the butt-ugly asymmetry between absolute and relative addresses, and introduce the concept of "hint flags" which can be used for such things as signedness of addresses, which is currently handled by passing in a negative size argument(!) What do people think? Is this important enough to risk deferring the release over? -hpa |
From: Cyrill G. <gor...@gm...> - 2016-02-06 19:05:44
|
On Fri, Feb 05, 2016 at 12:03:22PM -0800, H. Peter Anvin wrote: > I have checked in my code which I believe fixes macho64 into a branch, > simply because I think the code still needs some cleanup and a port > to 32 bits; ideally the two macho backends ought to be merged. > Doesn't work so far :( commit ae01785d872d3271d749a0866031d2d867120234 Author: H. Peter Anvin <hp...@li...> Date: Fri Feb 5 11:34:07 2016 -0800 LLVM portability fix for abs(size) ... bash-3.2$ make V=1 /Users/cyrill/projects/nasm/nasm -f macho64 -DPIC -DPREFIX -I./ -I.// -Pconfig.asm -I libavcodec/x86/ -M -o libavcodec/x86/vp9mc.o libavcodec/x86/vp9mc.asm > libavcodec/x86/vp9mc.d /Users/cyrill/projects/nasm/nasm -f macho64 -DPIC -DPREFIX -I./ -I.// -Pconfig.asm -I libavcodec/x86/ -o libavcodec/x86/vp9mc.o libavcodec/x86/vp9mc.asm strip -x -x libavcodec/x86/vp9mc.o rm -f libavcodec/libavcodec.a ar rc libavcodec/libavcodec.a ... gcc -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,-dynamic,-search_paths_first -Qunused-arguments -o ffmpeg_g cmdutils.o ffmpeg_opt.o ffmpeg_filter.o ffmpeg.o ffmpeg_videotoolbox.o -lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -framework QTKit -framework Foundation -framework QuartzCore -framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia -framework CoreFoundation -framework VideoToolbox -framework CoreMedia -framework QuartzCore -framework CoreVideo -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore -liconv -Wl,-framework,CoreFoundation -Wl,-framework,Security -framework CoreGraphics -lm -llzma -lbz2 -lz -pthread -framework CoreServices Undefined symbols for architecture x86_64: "_ff_filters_ssse3", referenced from: _put_8tap_smooth_64hv_8_ssse3 in libavcodec.a(vp9dsp_init.o) _put_8tap_regular_64hv_8_ssse3 in libavcodec.a(vp9dsp_init.o) _put_8tap_sharp_64hv_8_ssse3 in libavcodec.a(vp9dsp_init.o) _put_8tap_smooth_64v_8_ssse3 in libavcodec.a(vp9dsp_init.o) _put_8tap_regular_64v_8_ssse3 in libavcodec.a(vp9dsp_init.o) _put_8tap_sharp_64v_8_ssse3 in libavcodec.a(vp9dsp_init.o) _put_8tap_smooth_64h_8_ssse3 in libavcodec.a(vp9dsp_init.o) |
From: H. P. A. <hp...@zy...> - 2016-02-05 20:03:40
|
I have checked in my code which I believe fixes macho64 into a branch, simply because I think the code still needs some cleanup and a port to 32 bits; ideally the two macho backends ought to be merged. I also think we should drop the --allow-64-bit option and at most demote it to a warning. Right now some backends will outright malfunction if presented with 64-bit relocations, but if we can catch that in generic code (throwing an error instead) then we don't have to do surgery to every backend and still be able to generate 64-bit code as long as all the relocations are representable. For the specific case of 64-bit absolute relocation we could actually emit a 32-bit relocation and zero extend it, on the assumption that only 32-bit addresses will be used. That ought to be a warning, though. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. |
From: H. P. A. <hp...@zy...> - 2016-01-24 11:23:16
|
On January 24, 2016 3:18:34 AM PST, Cyrill Gorcunov <gor...@gm...> wrote: >On Sun, Jan 24, 2016 at 01:46:01AM -0800, H. Peter Anvin wrote: >> > >> > #define ZERO_BUF_SIZE 4096 >> >> One minor nit: this should be discovered by autoconf, >> and the functionality disabled if no such function >> is available. I can fix that. > >Got this mail after I pushed all changes upstream. >Could you please fetch repo and do it on top once >time permit? Yes. It is a minor nit. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. |
From: Cyrill G. <gor...@gm...> - 2016-01-24 11:18:43
|
On Sun, Jan 24, 2016 at 01:46:01AM -0800, H. Peter Anvin wrote: > > > > #define ZERO_BUF_SIZE 4096 > > One minor nit: this should be discovered by autoconf, > and the functionality disabled if no such function > is available. I can fix that. Got this mail after I pushed all changes upstream. Could you please fetch repo and do it on top once time permit? |
From: Cyrill G. <gor...@gm...> - 2016-01-24 11:17:28
|
On Sun, Jan 24, 2016 at 01:05:24AM -0800, H. Peter Anvin wrote: > > Unequivocally: > > Acked-by: H. Peter Anvin <hp...@zy...> All applied, thanks! |
From: H. P. A. <hp...@zy...> - 2016-01-24 09:48:32
|
On January 23, 2016 11:32:49 PM PST, Jim Kukunas <jam...@li...> wrote: >Converts a relative pathname to an absolute pathname. > >Signed-off-by: Jim Kukunas <jam...@li...> >--- > nasmlib.c | 12 ++++++++++++ > nasmlib.h | 7 +++++++ > 2 files changed, 19 insertions(+) > >diff --git a/nasmlib.c b/nasmlib.c >index ecd6d8d..9d57adb 100644 >--- a/nasmlib.c >+++ b/nasmlib.c >@@ -696,6 +696,18 @@ char *nasm_opt_val(char *p, char **val, char >**next) > return p; > } > >+#ifdef _WIN32 >+char *nasm_realpath(const char *rel_path) >+{ >+ return _fullpath(NULL, rel_path, 0); >+} >+#else >+char *nasm_realpath(const char *rel_path) >+{ >+ return realpath(rel_path, NULL); >+} >+#endif >+ > /* > * initialized data bytes length from opcode > */ >diff --git a/nasmlib.h b/nasmlib.h >index a3a8c12..9cd417f 100644 >--- a/nasmlib.h >+++ b/nasmlib.h >@@ -400,6 +400,13 @@ char *nasm_trim_spaces(char *p); > char *nasm_get_word(char *p, char **tail); > char *nasm_opt_val(char *p, char **opt, char **val); > >+/* >+ * Converts a relative pathname rel_path into an absolute path name. >+ * >+ * The buffer returned must be freed by the caller >+ */ >+char *nasm_realpath(const char *rel_path); >+ > const char *prefix_name(int); > > #define ZERO_BUF_SIZE 4096 One minor nit: this should be discovered by autoconf, and the functionality disabled if no such function is available. I can fix that. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. |
From: H. P. A. <hp...@zy...> - 2016-01-24 09:05:47
|
On January 24, 2016 12:23:14 AM PST, Cyrill Gorcunov <gor...@gm...> wrote: >On Sat, Jan 23, 2016 at 11:32:48PM -0800, Jim Kukunas wrote: >> >> Hi Folks, >> >> This patchset adds support for the Codeview 8 debug format for >PE/COFF files. >> >> The first two patches in this set lay the groundwork for the third. >The first >> patch adds a utility function for converting a relative path to an >absolute >> path, because Codeview wants absolute paths. Codeview stores an MD5 >hash of >> the source file, so the second patch adds an implementation that's in >the >> public domain. >> >> All of the interesting bits in the third patch are in codeview.c. >Prior to this >> patch, COFF hadn't supported a debug format, so the debugs hooks >weren't hooked >> up, nor were the necessary bits exposed external to outcoff.c. >> As a result, there's an ugly part of the diff for outcoff.c/pecoff.h >that hooks >> up the debug calls, exports some definitions and variables, and >renames the >> exported stuff to avoid collisions, e. g., Symbol -> coff_Symbol. I >can roll >> the ugly part into its own patch if it really bothers people. >> >> So far, I've tested this in WinDbg for both 32- and 64-bit code. >> >> For more information on the Codeview 8 format, see >https://github.com/yasm/yasm/blob/master/modules/dbgfmts/codeview/cv8.txt >> >> Let me know what you think. > >Wow! Thanks a huge! I believe it's very important feature. >If hpa@ agreed I would merge it asap for testing. Unequivocally: Acked-by: H. Peter Anvin <hp...@zy...> -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. |
From: Cyrill G. <gor...@gm...> - 2016-01-24 08:23:24
|
On Sat, Jan 23, 2016 at 11:32:48PM -0800, Jim Kukunas wrote: > > Hi Folks, > > This patchset adds support for the Codeview 8 debug format for PE/COFF files. > > The first two patches in this set lay the groundwork for the third. The first > patch adds a utility function for converting a relative path to an absolute > path, because Codeview wants absolute paths. Codeview stores an MD5 hash of > the source file, so the second patch adds an implementation that's in the > public domain. > > All of the interesting bits in the third patch are in codeview.c. Prior to this > patch, COFF hadn't supported a debug format, so the debugs hooks weren't hooked > up, nor were the necessary bits exposed external to outcoff.c. > As a result, there's an ugly part of the diff for outcoff.c/pecoff.h that hooks > up the debug calls, exports some definitions and variables, and renames the > exported stuff to avoid collisions, e. g., Symbol -> coff_Symbol. I can roll > the ugly part into its own patch if it really bothers people. > > So far, I've tested this in WinDbg for both 32- and 64-bit code. > > For more information on the Codeview 8 format, see https://github.com/yasm/yasm/blob/master/modules/dbgfmts/codeview/cv8.txt > > Let me know what you think. Wow! Thanks a huge! I believe it's very important feature. If hpa@ agreed I would merge it asap for testing. |
From: Jim K. <jam...@li...> - 2016-01-24 07:33:10
|
Codeview is a debug format for win32/win64 PE/COFF files. It adds two sections, .debug$S (symbols) and .debug$T (types), to the generated object file. These sections are then used by the linker to generate a PDB file which can be used by various debuggers (WinDbg, Visual Studio, etc). Signed-off-by: Jim Kukunas <jam...@li...> --- Makefile.in | 2 +- Mkfiles/msvc.mak | 2 +- output/codeview.c | 720 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ output/outcoff.c | 310 ++++++++++++----------- output/pecoff.h | 55 +++++ 5 files changed, 927 insertions(+), 162 deletions(-) create mode 100644 output/codeview.c diff --git a/Makefile.in b/Makefile.in index 9894d33..56f3589 100644 --- a/Makefile.in +++ b/Makefile.in @@ -92,7 +92,7 @@ NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \ preproc-nop.$(O) \ disp8.$(O) \ iflag.$(O) \ - md5c.$(O) + md5c.$(O) output/codeview.$(O) NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \ insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O) \ diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index a4df3e3..a2bae67 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -62,7 +62,7 @@ NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \ preproc-nop.$(O) \ disp8.$(O) \ iflag.$(O) \ - md5c.$(O) + md5c.$(O) output/codeview.$(O) NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \ insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O) \ diff --git a/output/codeview.c b/output/codeview.c new file mode 100644 index 0000000..4256e8d --- /dev/null +++ b/output/codeview.c @@ -0,0 +1,720 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 1996-2010 The NASM Authors - All Rights Reserved + * See the file AUTHORS included with the NASM distribution for + * the specific copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following + * conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ----------------------------------------------------------------------- */ + +/* + * codeview.c Codeview Debug Format support for COFF + */ + +#include "version.h" +#include "compiler.h" + +#include <stdio.h> +#include <stddef.h> +#include <stdlib.h> + +#include "nasm.h" +#include "nasmlib.h" +#include "saa.h" +#include "output/outlib.h" +#include "output/pecoff.h" +#include "md5.h" + +static void cv8_init(void); +static void cv8_linenum(const char *filename, int32_t linenumber, + int32_t segto); +static void cv8_deflabel(char *name, int32_t segment, int64_t offset, + int is_global, char *special); +static void cv8_typevalue(int32_t type); +static void cv8_output(int type, void *param); +static void cv8_cleanup(void); + +struct dfmt df_cv8 = { + .fullname = "Codeview 8", + .shortname = "cv8", + .init = cv8_init, + .linenum = cv8_linenum, + .debug_deflabel = cv8_deflabel, + .debug_directive = null_debug_directive, + .debug_typevalue = cv8_typevalue, + .debug_output = cv8_output, + .cleanup = cv8_cleanup, +}; + +/******************************************************************************* + * dfmt callbacks + ******************************************************************************/ +struct source_file { + char *name; + unsigned char md5sum[MD5_HASHBYTES]; +}; + +struct linepair { + uint32_t file_offset; + uint32_t linenumber; +}; + +enum symbol_type { + SYMTYPE_CODE, + SYMTYPE_PROC, + SYMTYPE_LDATA, + SYMTYPE_GDATA, + + SYMTYPE_MAX, +}; + +struct cv8_symbol { + enum symbol_type type; + char *name; + + uint32_t secrel; + uint16_t section; + uint32_t size; + uint32_t typeindex; + + enum symtype { + TYPE_UNREGISTERED = 0x0000, /* T_NOTYPE */ + TYPE_BYTE = 0x0020, + TYPE_WORD = 0x0021, + TYPE_DWORD= 0x0022, + TYPE_QUAD = 0x0023, + + TYPE_REAL32 = 0x0040, + TYPE_REAL64 = 0x0041, + TYPE_REAL80 = 0x0042, + TYPE_REAL128= 0x0043, + TYPE_REAL256= 0x0044, + TYPE_REAL512= 0x0045, + } symtype; +}; + +struct cv8_state { + int symbol_sect; + int type_sect; + + uint32_t text_offset; + + struct source_file source_file; + + struct SAA *lines; + uint32_t num_lines; + + struct SAA *symbols; + struct cv8_symbol *last_sym; + unsigned num_syms[SYMTYPE_MAX]; + unsigned symbol_lengths; + unsigned total_syms; + + char *cwd; +}; +struct cv8_state cv8_state; + +static void cv8_init(void) +{ + const uint32_t sect_flags = IMAGE_SCN_MEM_READ | + IMAGE_SCN_MEM_DISCARDABLE | + IMAGE_SCN_CNT_INITIALIZED_DATA | + IMAGE_SCN_ALIGN_1BYTES; + + cv8_state.symbol_sect = coff_make_section(".debug$S", sect_flags); + cv8_state.type_sect = coff_make_section(".debug$T", sect_flags); + + cv8_state.text_offset = 0; + + cv8_state.lines = saa_init(sizeof(struct linepair)); + cv8_state.num_lines = 0; + + cv8_state.symbols = saa_init(sizeof(struct cv8_symbol)); + cv8_state.last_sym = NULL; + + cv8_state.cwd = nasm_realpath("."); +} + +static void register_file(const char *filename); +static struct coff_Section *find_section(int32_t segto); + +static void cv8_linenum(const char *filename, int32_t linenumber, + int32_t segto) +{ + struct coff_Section *s; + struct linepair *li; + + if (cv8_state.source_file.name == NULL) + register_file(filename); + + s = find_section(segto); + if (s == NULL) + return; + + if ((s->flags & IMAGE_SCN_MEM_EXECUTE) == 0) + return; + + li = saa_wstruct(cv8_state.lines); + li->file_offset = cv8_state.text_offset; + li->linenumber = linenumber; + + cv8_state.num_lines++; +} + +static void cv8_deflabel(char *name, int32_t segment, int64_t offset, + int is_global, char *special) +{ + int ret; + size_t len; + struct cv8_symbol *sym; + struct coff_Section *s; + + (void)special; + + s = find_section(segment); + if (s == NULL) + return; + + sym = saa_wstruct(cv8_state.symbols); + + if (s->flags & IMAGE_SCN_MEM_EXECUTE) + sym->type = is_global ? SYMTYPE_PROC : SYMTYPE_CODE; + else + sym->type = is_global ? SYMTYPE_GDATA : SYMTYPE_LDATA; + cv8_state.num_syms[sym->type]++; + cv8_state.total_syms++; + + sym->section = segment; + sym->secrel = offset; + sym->symtype = TYPE_UNREGISTERED; + sym->size = 0; + sym->typeindex = 0; + + /* handle local labels */ + if (name[0] == '.' && cv8_state.last_sym != NULL) { + len = strlen(cv8_state.last_sym->name) + strlen(name); + sym->name = nasm_malloc(len + 1); + ret = snprintf(sym->name, len + 1, "%s%s", + cv8_state.last_sym->name, name); + nasm_assert(ret > 0 && (size_t)ret == len); + } else { + len = strlen(name); + sym->name = nasm_malloc(len + 1); + ret = snprintf(sym->name, len + 1, "%s", name); + nasm_assert(ret > 0 && (size_t)ret == len); + } + + cv8_state.symbol_lengths += len + 1; + + if (cv8_state.last_sym && cv8_state.last_sym->section == segment) + cv8_state.last_sym->size = offset - cv8_state.last_sym->secrel; + cv8_state.last_sym = sym; +} + +static void cv8_typevalue(int32_t type) +{ + if (!cv8_state.last_sym) + return; + if (cv8_state.last_sym->symtype != TYPE_UNREGISTERED) + return; + + switch (TYM_TYPE(type)) { + case TY_BYTE: + cv8_state.last_sym->symtype = TYPE_BYTE; + break; + case TY_WORD: + cv8_state.last_sym->symtype = TYPE_WORD; + break; + case TY_DWORD: + cv8_state.last_sym->symtype = TYPE_DWORD; + break; + case TY_QWORD: + cv8_state.last_sym->symtype = TYPE_QUAD; + break; + case TY_FLOAT: + cv8_state.last_sym->symtype = TYPE_REAL32; + break; + case TY_TBYTE: + cv8_state.last_sym->symtype = TYPE_REAL80; + break; + case TY_OWORD: + cv8_state.last_sym->symtype = TYPE_REAL128; + break; + case TY_YWORD: + cv8_state.last_sym->symtype = TYPE_REAL256; + break; + case TY_UNKNOWN: + break; + case TY_LABEL: + break; + } +} + +static void cv8_output(int type, void *param) +{ + struct coff_DebugInfo *dinfo = param; + + (void)type; + + if (dinfo->section && dinfo->section->name && + !strncmp(dinfo->section->name, ".text", 5)) + cv8_state.text_offset += dinfo->size; +} + +static void build_symbol_table(struct coff_Section *const sect); +static void build_type_table(struct coff_Section *const sect); + +static void cv8_cleanup(void) +{ + struct cv8_symbol *sym; + + struct coff_Section *symbol_sect = coff_sects[cv8_state.symbol_sect]; + struct coff_Section *type_sect = coff_sects[cv8_state.type_sect]; + + build_symbol_table(symbol_sect); + build_type_table(type_sect); + + if (cv8_state.source_file.name != NULL) + free(cv8_state.source_file.name); + + if (cv8_state.cwd != NULL) + free(cv8_state.cwd); + + saa_free(cv8_state.lines); + + saa_rewind(cv8_state.symbols); + while ((sym = saa_rstruct(cv8_state.symbols))) + free(sym->name); + saa_free(cv8_state.symbols); +} + +/******************************************************************************* + * implementation + ******************************************************************************/ +static void calc_md5(const char *const filename, + unsigned char sum[MD5_HASHBYTES]) +{ + int success = 0; + unsigned char *file_buf; + FILE *f; + MD5_CTX ctx; + + f = fopen(filename, "r"); + if (!f) + goto done; + + file_buf = nasm_zalloc(BUFSIZ); + + MD5Init(&ctx); + while (!feof(f)) { + size_t i = fread(file_buf, 1, BUFSIZ, f); + if (ferror(f)) + goto done_0; + else if (i == 0) + break; + MD5Update(&ctx, file_buf, i); + } + MD5Final(sum, &ctx); + + success = 1; +done_0: + nasm_free(file_buf); + fclose(f); +done: + if (!success) { + nasm_error(ERR_NONFATAL, "unable to hash file %s. " + "Debug information may be unavailable.\n", + filename); + } + return; +} + +static void register_file(const char *filename) +{ + cv8_state.source_file.name = nasm_realpath(filename); + memset(cv8_state.source_file.md5sum, 0, MD5_HASHBYTES); + calc_md5(filename, cv8_state.source_file.md5sum); +} + +static struct coff_Section *find_section(int32_t segto) +{ + int i; + + for (i = 0; i < coff_nsects; i++) { + struct coff_Section *sec; + + sec = coff_sects[i]; + if (segto == sec->index) + return sec; + } + return NULL; +} + +static void register_reloc(struct coff_Section *const sect, + char *sym, uint32_t addr, uint16_t type) +{ + struct coff_Reloc *r; + struct coff_Section *sec; + + r = *sect->tail = nasm_malloc(sizeof(struct coff_Reloc)); + sect->tail = &r->next; + r->next = NULL; + sect->nrelocs++; + + r->address = addr; + r->symbase = SECT_SYMBOLS; + r->type = type; + + r->symbol = 0; + for (int i = 0; i < coff_nsects; i++) { + sec = coff_sects[i]; + if (!strcmp(sym, sec->name)) { + return; + } + r->symbol += 2; + } + + saa_rewind(coff_syms); + for (uint32_t i = 0; i < coff_nsyms; i++) { + struct coff_Symbol *s = saa_rstruct(coff_syms); + r->symbol++; + if (s->strpos == -1 && s->name && !strcmp(sym, s->name)) { + return; + } else if (s->strpos != -1) { + int res; + char *symname; + + symname = nasm_malloc(s->namlen + 1); + saa_fread(coff_strs, s->strpos-4, symname, s->namlen); + symname[s->namlen] = '\0'; + res = strcmp(sym, symname); + nasm_free(symname); + if (!res) + return; + } + } + nasm_assert(!"relocation for unregistered symbol"); +} + +static inline void section_write32(struct coff_Section *sect, uint32_t val) +{ + saa_write32(sect->data, val); + sect->len += 4; +} + +static inline void section_write16(struct coff_Section *sect, uint16_t val) +{ + saa_write16(sect->data, val); + sect->len += 2; +} + +static inline void section_write8(struct coff_Section *sect, uint8_t val) +{ + saa_write8(sect->data, val); + sect->len++; +} + +static inline void section_wbytes(struct coff_Section *sect, const void *buf, + size_t len) +{ + saa_wbytes(sect->data, buf, len); + sect->len += len; +} + +static void write_filename_table(struct coff_Section *const sect) +{ + uint32_t field_length = 0; + size_t filename_len = strlen(cv8_state.source_file.name); + + field_length = 1 + filename_len + 1; + + section_write32(sect, 0x000000F3); + section_write32(sect, field_length); + + section_write8(sect, 0); + section_wbytes(sect, cv8_state.source_file.name, filename_len + 1); +} + +static void write_sourcefile_table(struct coff_Section *const sect) +{ + uint32_t field_length = 0; + + field_length = 4 + 2 + MD5_HASHBYTES + 2; + + section_write32(sect, 0x000000F4); + section_write32(sect, field_length); + + section_write32(sect, 1); /* offset of filename in filename str table */ + section_write16(sect, 0x0110); + section_wbytes(sect, cv8_state.source_file.md5sum, MD5_HASHBYTES); + section_write16(sect, 0); +} + +static void write_linenumber_table(struct coff_Section *const sect) +{ + int i; + uint32_t field_length = 0; + size_t field_base; + struct coff_Section *s; + struct linepair *li; + + for (i = 0; i < coff_nsects; i++) { + if (!strncmp(coff_sects[i]->name, ".text", 5)) + break; + } + + if (i == coff_nsects) + return; + s = coff_sects[i]; + + field_length = 12 + 12 + (cv8_state.num_lines * 8); + + section_write32(sect, 0x000000F2); + section_write32(sect, field_length); + + field_base = sect->len; + section_write32(sect, 0); /* SECREL, updated by relocation */ + section_write16(sect, 0); /* SECTION, updated by relocation*/ + section_write16(sect, 0); /* pad */ + section_write32(sect, s->len); + + register_reloc(sect, ".text", field_base, + win64 ? IMAGE_REL_AMD64_SECREL : IMAGE_REL_I386_SECREL); + + register_reloc(sect, ".text", field_base + 4, + win64 ? IMAGE_REL_AMD64_SECTION : IMAGE_REL_I386_SECTION); + + /* 1 or more source mappings (we assume only 1) */ + section_write32(sect, 0); + section_write32(sect, cv8_state.num_lines); + section_write32(sect, 12 + (cv8_state.num_lines * 8)); + + /* the pairs */ + saa_rewind(cv8_state.lines); + while ((li = saa_rstruct(cv8_state.lines))) { + section_write32(sect, li->file_offset); + section_write32(sect, li->linenumber |= 0x80000000); + } +} + +static uint16_t write_symbolinfo_obj(struct coff_Section *sect, + const char sep) +{ + uint16_t obj_len; + + obj_len = 2 + 4 + strlen(cv8_state.cwd)+ 1 + strlen(coff_outfile) +1; + + section_write16(sect, obj_len); + section_write16(sect, 0x1101); + section_write32(sect, 0); /* ASM language */ + section_wbytes(sect, cv8_state.cwd, strlen(cv8_state.cwd)); + section_write8(sect, sep); + section_wbytes(sect, coff_outfile, strlen(coff_outfile)+1); + + return obj_len; +} + +static uint16_t write_symbolinfo_properties(struct coff_Section *sect, + const char *const creator_str) +{ + uint16_t creator_len; + + creator_len = 2 + 4 + 4 + 4 + 4 + strlen(creator_str)+1 + 2; + + section_write16(sect, creator_len); + section_write16(sect, 0x1116); + section_write32(sect, 3); /* language */ + if (win64) + section_write32(sect, 0x000000D0); + else if (win32) + section_write32(sect, 0x00000006); + else + nasm_assert(!"neither win32 nor win64 are set!"); + section_write32(sect, 0); /* flags*/ + section_write32(sect, 8); /* version */ + section_wbytes(sect, creator_str, strlen(creator_str)+1); + /* + * normally there would be key/value pairs here, but they aren't + * necessary. They are terminated by 2B + */ + section_write16(sect, 0); + + return creator_len; +} + +static uint16_t write_symbolinfo_symbols(struct coff_Section *sect) +{ + uint16_t len = 0, field_len; + uint32_t field_base; + struct cv8_symbol *sym; + + saa_rewind(cv8_state.symbols); + while ((sym = saa_rstruct(cv8_state.symbols))) { + switch (sym->type) { + case SYMTYPE_LDATA: + case SYMTYPE_GDATA: + field_len = 12 + strlen(sym->name) + 1; + len += field_len - 2; + section_write16(sect, field_len); + if (sym->type == SYMTYPE_LDATA) + section_write16(sect, 0x110C); + else + section_write16(sect, 0x110D); + section_write32(sect, sym->symtype); + + field_base = sect->len; + section_write32(sect, 0); /* SECREL */ + section_write16(sect, 0); /* SECTION */ + break; + case SYMTYPE_PROC: + case SYMTYPE_CODE: + field_len = 9 + strlen(sym->name) + 1; + len += field_len - 2; + section_write16(sect, field_len); + section_write16(sect, 0x1105); + + field_base = sect->len; + section_write32(sect, 0); /* SECREL */ + section_write16(sect, 0); /* SECTION */ + section_write8(sect, 0); /* FLAG */ + break; + default: + nasm_assert(!"unknown symbol type"); + } + + section_wbytes(sect, sym->name, strlen(sym->name) + 1); + + register_reloc(sect, sym->name, field_base, + win64 ? IMAGE_REL_AMD64_SECREL : + IMAGE_REL_I386_SECREL); + register_reloc(sect, sym->name, field_base + 4, + win64 ? IMAGE_REL_AMD64_SECTION : + IMAGE_REL_I386_SECTION); + } + + return len; +} + +static void write_symbolinfo_table(struct coff_Section *const sect) +{ + const char sep = '\\'; + const char *creator_str = "The Netwide Assembler " NASM_VER; + + + uint16_t obj_length, creator_length, sym_length; + uint32_t field_length = 0, out_len; + + /* signature, language, workingdir / coff_outfile NULL */ + obj_length = 2 + 4 + strlen(cv8_state.cwd)+ 1 + strlen(coff_outfile) +1; + creator_length = 2 + 4 + 4 + 4 + 4 + strlen(creator_str)+1 + 2; + + sym_length = ( cv8_state.num_syms[SYMTYPE_CODE] * 7) + + ( cv8_state.num_syms[SYMTYPE_PROC] * 7) + + ( cv8_state.num_syms[SYMTYPE_LDATA] * 10) + + ( cv8_state.num_syms[SYMTYPE_GDATA] * 10) + + cv8_state.symbol_lengths; + + field_length = 2 + obj_length + + 2 + creator_length + + (4 * cv8_state.total_syms) + sym_length; + + section_write32(sect, 0x000000F1); + section_write32(sect, field_length); + + /* for sub fields, length preceeds type */ + + out_len = write_symbolinfo_obj(sect, sep); + nasm_assert(out_len == obj_length); + + out_len = write_symbolinfo_properties(sect, creator_str); + nasm_assert(out_len == creator_length); + + out_len = write_symbolinfo_symbols(sect); + nasm_assert(out_len == sym_length); +} + +static inline void align4_table(struct coff_Section *const sect) +{ + unsigned diff; + uint32_t zero = 0; + struct SAA *data = sect->data; + + if (data->wptr % 4 == 0) + return; + + diff = 4 - (data->wptr % 4); + if (diff) + section_wbytes(sect, &zero, diff); +} + +static void build_symbol_table(struct coff_Section *const sect) +{ + section_write32(sect, 0x00000004); + + write_filename_table(sect); + align4_table(sect); + write_sourcefile_table(sect); + align4_table(sect); + write_linenumber_table(sect); + align4_table(sect); + write_symbolinfo_table(sect); + align4_table(sect); +} + +static void build_type_table(struct coff_Section *const sect) +{ + uint16_t field_len; + struct cv8_symbol *sym; + + section_write32(sect, 0x00000004); + + saa_rewind(cv8_state.symbols); + while ((sym = saa_rstruct(cv8_state.symbols))) { + if (sym->type != SYMTYPE_PROC) + continue; + + /* proc leaf */ + + field_len = 2 + 4 + 4 + 4 + 2; + section_write16(sect, field_len); + section_write16(sect, 0x1008); /* PROC type */ + + section_write32(sect, 0x00000003); /* return type */ + section_write32(sect, 0); /* calling convention (default) */ + section_write32(sect, sym->typeindex); + section_write16(sect, 0); /* # params */ + + /* arglist */ + + field_len = 2 + 4; + section_write16(sect, field_len); + section_write16(sect, 0x1201); /* ARGLIST */ + section_write32(sect, 0); /*num params */ + } +} + + diff --git a/output/outcoff.c b/output/outcoff.c index 2d55fd0..b45e4f1 100644 --- a/output/outcoff.c +++ b/output/outcoff.c @@ -100,47 +100,13 @@ */ /* Flag which version of COFF we are currently outputting. */ -static bool win32, win64; +bool win32, win64; static int32_t imagebase_sect; #define WRT_IMAGEBASE "..imagebase" -struct Reloc { - struct Reloc *next; - int32_t address; /* relative to _start_ of section */ - int32_t symbol; /* symbol number */ - enum { - SECT_SYMBOLS, - ABS_SYMBOL, - REAL_SYMBOLS - } symbase; /* relocation for symbol number :) */ - int16_t type; -}; - -struct Symbol { - char name[9]; - int32_t strpos; /* string table position of name */ - int32_t value; /* address, or COMMON variable size */ - int section; /* section number where it's defined - * - in COFF codes, not NASM codes */ - bool is_global; /* is it a global symbol or not? */ - int16_t type; /* 0 - notype, 0x20 - function */ - int32_t namlen; /* full name length */ -}; - -static char coff_infile[FILENAME_MAX]; - -struct Section { - struct SAA *data; - uint32_t len; - int nrelocs; - int32_t index; - struct Reloc *head, **tail; - uint32_t flags; /* section flags */ - char *name; - int32_t namepos; /* Offset of name into the strings table */ - int32_t pos, relpos; -}; +char coff_infile[FILENAME_MAX]; +char coff_outfile[FILENAME_MAX]; /* * Some common section flags by default @@ -198,11 +164,12 @@ struct Section { #define RDATA_FLAGS ((win32 | win64) ? RDATA_FLAGS_WIN : RDATA_FLAGS_DOS) #define SECT_DELTA 32 -static struct Section **sects; -static int nsects, sectlen; +struct coff_Section **coff_sects; +static int sectlen; +int coff_nsects; -static struct SAA *syms; -static uint32_t nsyms; +struct SAA *coff_syms; +uint32_t coff_nsyms; static int32_t def_seg; @@ -210,14 +177,14 @@ static int initsym; static struct RAA *bsym, *symval; -static struct SAA *strs; +struct SAA *coff_strs; static uint32_t strslen; static void coff_gen_init(void); -static void coff_sect_write(struct Section *, const uint8_t *, uint32_t); +static void coff_sect_write(struct coff_Section *, const uint8_t *, uint32_t); static void coff_write(void); static void coff_section_header(char *, int32_t, int32_t, int32_t, int32_t, int32_t, int, int32_t); -static void coff_write_relocs(struct Section *); +static void coff_write_relocs(struct coff_Section *); static void coff_write_symbols(void); static void coff_win32_init(void) @@ -246,46 +213,47 @@ static void coff_std_init(void) static void coff_gen_init(void) { - sects = NULL; - nsects = sectlen = 0; - syms = saa_init(sizeof(struct Symbol)); - nsyms = 0; + coff_sects = NULL; + coff_nsects = sectlen = 0; + coff_syms = saa_init(sizeof(struct coff_Symbol)); + coff_nsyms = 0; bsym = raa_init(); symval = raa_init(); - strs = saa_init(1); + coff_strs = saa_init(1); strslen = 0; def_seg = seg_alloc(); } static void coff_cleanup(int debuginfo) { - struct Reloc *r; + struct coff_Reloc *r; int i; - (void)debuginfo; + if (debuginfo && ofmt->current_dfmt->cleanup) + ofmt->current_dfmt->cleanup(); coff_write(); - for (i = 0; i < nsects; i++) { - if (sects[i]->data) - saa_free(sects[i]->data); - while (sects[i]->head) { - r = sects[i]->head; - sects[i]->head = sects[i]->head->next; + for (i = 0; i < coff_nsects; i++) { + if (coff_sects[i]->data) + saa_free(coff_sects[i]->data); + while (coff_sects[i]->head) { + r = coff_sects[i]->head; + coff_sects[i]->head = coff_sects[i]->head->next; nasm_free(r); } - nasm_free(sects[i]->name); - nasm_free(sects[i]); + nasm_free(coff_sects[i]->name); + nasm_free(coff_sects[i]); } - nasm_free(sects); - saa_free(syms); + nasm_free(coff_sects); + saa_free(coff_syms); raa_free(bsym); raa_free(symval); - saa_free(strs); + saa_free(coff_strs); } -static int coff_make_section(char *name, uint32_t flags) +int coff_make_section(char *name, uint32_t flags) { - struct Section *s; + struct coff_Section *s; size_t namelen; s = nasm_zalloc(sizeof(*s)); @@ -302,7 +270,7 @@ static int coff_make_section(char *name, uint32_t flags) if (namelen > 8) { if (win32 || win64) { s->namepos = strslen + 4; - saa_wbytes(strs, name, namelen + 1); + saa_wbytes(coff_strs, name, namelen + 1); strslen += namelen + 1; } else { namelen = 8; @@ -313,13 +281,13 @@ static int coff_make_section(char *name, uint32_t flags) s->name[namelen] = '\0'; s->flags = flags; - if (nsects >= sectlen) { + if (coff_nsects >= sectlen) { sectlen += SECT_DELTA; - sects = nasm_realloc(sects, sectlen * sizeof(*sects)); + coff_sects = nasm_realloc(coff_sects, sectlen * sizeof(*coff_sects)); } - sects[nsects++] = s; + coff_sects[coff_nsects++] = s; - return nsects - 1; + return coff_nsects - 1; } static inline int32_t coff_sectalign_flags(unsigned int align) @@ -418,10 +386,10 @@ static int32_t coff_section_names(char *name, int pass, int *bits) } } - for (i = 0; i < nsects; i++) - if (!strcmp(name, sects[i]->name)) + for (i = 0; i < coff_nsects; i++) + if (!strcmp(name, coff_sects[i]->name)) break; - if (i == nsects) { + if (i == coff_nsects) { if (!flags) { if (!strcmp(name, ".data")) flags = DATA_FLAGS; @@ -438,56 +406,56 @@ static int32_t coff_section_names(char *name, int pass, int *bits) } i = coff_make_section(name, flags); if (flags) - sects[i]->flags = flags; - sects[i]->flags &= align_and; - sects[i]->flags |= align_or; + coff_sects[i]->flags = flags; + coff_sects[i]->flags &= align_and; + coff_sects[i]->flags |= align_or; } else if (pass == 1) { /* Check if any flags are specified */ if (flags) { unsigned int align_flags = flags & IMAGE_SCN_ALIGN_MASK; /* Warn if non-alignment flags differ */ - if ((flags ^ sects[i]->flags) & ~IMAGE_SCN_ALIGN_MASK) { + if ((flags ^ coff_sects[i]->flags) & ~IMAGE_SCN_ALIGN_MASK) { nasm_error(ERR_WARNING, "section attributes ignored on" " redeclaration of section `%s'", name); } /* Check if alignment might be needed */ if (align_flags > IMAGE_SCN_ALIGN_1BYTES) { - unsigned int sect_align_flags = sects[i]->flags & IMAGE_SCN_ALIGN_MASK; + unsigned int sect_align_flags = coff_sects[i]->flags & IMAGE_SCN_ALIGN_MASK; /* Compute the actual alignment */ unsigned int align = 1u << ((align_flags - IMAGE_SCN_ALIGN_1BYTES) >> 20); /* Update section header as needed */ if (align_flags > sect_align_flags) { - sects[i]->flags = (sects[i]->flags & ~IMAGE_SCN_ALIGN_MASK) | align_flags; + coff_sects[i]->flags = (coff_sects[i]->flags & ~IMAGE_SCN_ALIGN_MASK) | align_flags; } /* Check if not already aligned */ - if (sects[i]->len % align) { - unsigned int padding = (align - sects[i]->len) % align; + if (coff_sects[i]->len % align) { + unsigned int padding = (align - coff_sects[i]->len) % align; /* We need to write at most 8095 bytes */ char buffer[8095]; - if (sects[i]->flags & IMAGE_SCN_CNT_CODE) { + if (coff_sects[i]->flags & IMAGE_SCN_CNT_CODE) { /* Fill with INT 3 instructions */ memset(buffer, 0xCC, padding); } else { memset(buffer, 0x00, padding); } - saa_wbytes(sects[i]->data, buffer, padding); - sects[i]->len += padding; + saa_wbytes(coff_sects[i]->data, buffer, padding); + coff_sects[i]->len += padding; } } } } - return sects[i]->index; + return coff_sects[i]->index; } static void coff_deflabel(char *name, int32_t segment, int64_t offset, int is_global, char *special) { int pos = strslen + 4; - struct Symbol *sym; + struct coff_Symbol *sym; if (special) nasm_error(ERR_NONFATAL, "COFF format does not support any" @@ -501,12 +469,12 @@ static void coff_deflabel(char *name, int32_t segment, int64_t offset, if (strlen(name) > 8) { size_t nlen = strlen(name)+1; - saa_wbytes(strs, name, nlen); + saa_wbytes(coff_strs, name, nlen); strslen += nlen; } else pos = -1; - sym = saa_wstruct(syms); + sym = saa_wstruct(coff_syms); sym->strpos = pos; sym->namlen = strlen(name); @@ -519,8 +487,8 @@ static void coff_deflabel(char *name, int32_t segment, int64_t offset, else { int i; sym->section = 0; - for (i = 0; i < nsects; i++) - if (segment == sects[i]->index) { + for (i = 0; i < coff_nsects; i++) + if (segment == coff_sects[i]->index) { sym->section = i + 1; break; } @@ -537,20 +505,20 @@ static void coff_deflabel(char *name, int32_t segment, int64_t offset, * to these symbol records. */ if (sym->section == 0) - bsym = raa_write(bsym, segment, nsyms); + bsym = raa_write(bsym, segment, coff_nsyms); if (segment != NO_SEG) symval = raa_write(symval, segment, sym->section ? 0 : sym->value); - nsyms++; + coff_nsyms++; } -static int32_t coff_add_reloc(struct Section *sect, int32_t segment, +static int32_t coff_add_reloc(struct coff_Section *sect, int32_t segment, int16_t type) { - struct Reloc *r; + struct coff_Reloc *r; - r = *sect->tail = nasm_malloc(sizeof(struct Reloc)); + r = *sect->tail = nasm_malloc(sizeof(struct coff_Reloc)); sect->tail = &r->next; r->next = NULL; @@ -560,8 +528,8 @@ static int32_t coff_add_reloc(struct Section *sect, int32_t segment, } else { int i; r->symbase = REAL_SYMBOLS; - for (i = 0; i < nsects; i++) { - if (segment == sects[i]->index) { + for (i = 0; i < coff_nsects; i++) { + if (segment == coff_sects[i]->index) { r->symbol = i * 2; r->symbase = SECT_SYMBOLS; break; @@ -587,7 +555,7 @@ static void coff_out(int32_t segto, const void *data, enum out_type type, uint64_t size, int32_t segment, int32_t wrt) { - struct Section *s; + struct coff_Section *s; uint8_t mydata[8], *p; int i; @@ -607,9 +575,9 @@ static void coff_out(int32_t segto, const void *data, } s = NULL; - for (i = 0; i < nsects; i++) { - if (segto == sects[i]->index) { - s = sects[i]; + for (i = 0; i < coff_nsects; i++) { + if (segto == coff_sects[i]->index) { + s = coff_sects[i]; break; } } @@ -618,7 +586,7 @@ static void coff_out(int32_t segto, const void *data, if (segto != coff_section_names(".text", 2, &tempint)) nasm_error(ERR_PANIC, "strange segment conditions in COFF driver"); else - s = sects[nsects - 1]; + s = coff_sects[coff_nsects - 1]; } /* magically default to 'wrt ..imagebase' in .pdata and .xdata */ @@ -636,6 +604,20 @@ static void coff_out(int32_t segto, const void *data, memset(mydata, 0, sizeof(mydata)); + if (ofmt->current_dfmt && ofmt->current_dfmt->debug_output) { + struct coff_DebugInfo dinfo; + dinfo.segto = segto; + dinfo.seg = segment; + dinfo.section = s; + + if (type == OUT_ADDRESS) + dinfo.size = abs(size); + else + dinfo.size = realsize(type, size); + + ofmt->current_dfmt->debug_output(type, &dinfo); + } + if (type == OUT_RESERVE) { if (s->data) { nasm_error(ERR_WARNING, "uninitialised space declared in" @@ -717,7 +699,7 @@ static void coff_out(int32_t segto, const void *data, } } -static void coff_sect_write(struct Section *sect, +static void coff_sect_write(struct coff_Section *sect, const uint8_t *data, uint32_t len) { saa_wbytes(sect->data, data, len); @@ -738,7 +720,7 @@ typedef struct tagString { */ static STRING *Exports = NULL; -static struct Section *directive_sec; +static struct coff_Section *directive_sec; static void AddExport(char *name) { STRING *rvp = Exports, *newS; @@ -751,15 +733,15 @@ static void AddExport(char *name) if (rvp == NULL) { int i; - for (i = 0; i < nsects; i++) { - if (!strcmp(EXPORT_SECTION_NAME, sects[i]->name)) + for (i = 0; i < coff_nsects; i++) { + if (!strcmp(EXPORT_SECTION_NAME, coff_sects[i]->name)) break; } - if (i == nsects) + if (i == coff_nsects) i = coff_make_section(EXPORT_SECTION_NAME, EXPORT_SECTION_FLAGS); - directive_sec = sects[i]; + directive_sec = coff_sects[i]; Exports = newS; } else { while (rvp->next) { @@ -827,10 +809,10 @@ static int coff_directives(enum directives directive, char *value, int pass) return 0; if (sxseg == -1) { - for (i = 0; i < nsects; i++) - if (!strcmp(".sxdata",sects[i]->name)) + for (i = 0; i < coff_nsects; i++) + if (!strcmp(".sxdata",coff_sects[i]->name)) break; - if (i == nsects) + if (i == coff_nsects) sxseg = coff_make_section(".sxdata", IMAGE_SCN_LNK_INFO); else sxseg = i; @@ -841,9 +823,9 @@ static int coff_directives(enum directives directive, char *value, int pass) */ if (pass0 == 2) { uint32_t n; - saa_rewind(syms); - for (n = 0; n < nsyms; n++) { - struct Symbol *sym = saa_rstruct(syms); + saa_rewind(coff_syms); + for (n = 0; n < coff_nsyms; n++) { + struct coff_Symbol *sym = saa_rstruct(coff_syms); bool equals; /* @@ -852,7 +834,7 @@ static int coff_directives(enum directives directive, char *value, int pass) */ if (sym->strpos >=4) { char *name = nasm_malloc(sym->namlen+1); - saa_fread(strs, sym->strpos-4, name, sym->namlen); + saa_fread(coff_strs, sym->strpos-4, name, sym->namlen); name[sym->namlen] = '\0'; equals = !strcmp(value,name); nasm_free(name); @@ -867,13 +849,13 @@ static int coff_directives(enum directives directive, char *value, int pass) * .absolute and two per each section */ unsigned char value[4],*p=value; - WRITELONG(p,n + 2 + 1 + nsects*2); - coff_sect_write(sects[sxseg],value,4); + WRITELONG(p,n + 2 + 1 + coff_nsects*2); + coff_sect_write(coff_sects[sxseg],value,4); sym->type = 0x20; break; } } - if (n == nsyms) { + if (n == coff_nsyms) { nasm_error(ERR_NONFATAL, "`safeseh' directive requires valid symbol"); } @@ -886,7 +868,7 @@ static int coff_directives(enum directives directive, char *value, int pass) } /* handle relocations storm, valid for win32/64 only */ -static inline void coff_adjust_relocs(struct Section *s) +static inline void coff_adjust_relocs(struct coff_Section *s) { if (s->nrelocs < IMAGE_SCN_MAX_RELOC) return; @@ -916,13 +898,13 @@ static void coff_write(void) /* add default value for @feat.00, this allows to 'link /safeseh' */ uint32_t n; - saa_rewind(syms); - for (n = 0; n < nsyms; n++) { - struct Symbol *sym = saa_rstruct(syms); + saa_rewind(coff_syms); + for (n = 0; n < coff_nsyms; n++) { + struct coff_Symbol *sym = saa_rstruct(coff_syms); if (sym->strpos == -1 && !strcmp("@feat.00",sym->name)) break; } - if (n == nsyms) + if (n == coff_nsyms) coff_deflabel("@feat.00", NO_SEG, 1, 0, NULL); } @@ -931,17 +913,17 @@ static void coff_write(void) * Calculate the start of the `real' symbols at the same time. * Check for massive relocations. */ - pos = 0x14 + 0x28 * nsects; + pos = 0x14 + 0x28 * coff_nsects; initsym = 3; /* two for the file, one absolute */ - for (i = 0; i < nsects; i++) { - if (sects[i]->data) { - coff_adjust_relocs(sects[i]); - sects[i]->pos = pos; - pos += sects[i]->len; - sects[i]->relpos = pos; - pos += 10 * sects[i]->nrelocs; + for (i = 0; i < coff_nsects; i++) { + if (coff_sects[i]->data) { + coff_adjust_relocs(coff_sects[i]); + coff_sects[i]->pos = pos; + pos += coff_sects[i]->len; + coff_sects[i]->relpos = pos; + pos += 10 * coff_sects[i]->nrelocs; } else - sects[i]->pos = sects[i]->relpos = 0L; + coff_sects[i]->pos = coff_sects[i]->relpos = 0L; initsym += 2; /* two for each section */ } sympos = pos; @@ -954,10 +936,10 @@ static void coff_write(void) else i = IMAGE_FILE_MACHINE_I386; fwriteint16_t(i, ofile); /* machine type */ - fwriteint16_t(nsects, ofile); /* number of sections */ + fwriteint16_t(coff_nsects, ofile); /* number of sections */ fwriteint32_t(time(NULL), ofile); /* time stamp */ fwriteint32_t(sympos, ofile); - fwriteint32_t(nsyms + initsym, ofile); + fwriteint32_t(coff_nsyms + initsym, ofile); fwriteint16_t(0, ofile); /* no optional header */ /* Flags: 32-bit, no line numbers. Win32 doesn't even bother with them. */ fwriteint16_t((win32 | win64) ? 0 : 0x104, ofile); @@ -966,20 +948,20 @@ static void coff_write(void) * Output the section headers. */ vsize = 0L; - for (i = 0; i < nsects; i++) { - coff_section_header(sects[i]->name, sects[i]->namepos, vsize, sects[i]->len, - sects[i]->pos, sects[i]->relpos, - sects[i]->nrelocs, sects[i]->flags); - vsize += sects[i]->len; + for (i = 0; i < coff_nsects; i++) { + coff_section_header(coff_sects[i]->name, coff_sects[i]->namepos, vsize, coff_sects[i]->len, + coff_sects[i]->pos, coff_sects[i]->relpos, + coff_sects[i]->nrelocs, coff_sects[i]->flags); + vsize += coff_sects[i]->len; } /* * Output the sections and their relocations. */ - for (i = 0; i < nsects; i++) - if (sects[i]->data) { - saa_fpwrite(sects[i]->data, ofile); - coff_write_relocs(sects[i]); + for (i = 0; i < coff_nsects; i++) + if (coff_sects[i]->data) { + saa_fpwrite(coff_sects[i]->data, ofile); + coff_write_relocs(coff_sects[i]); } /* @@ -987,7 +969,7 @@ static void coff_write(void) */ coff_write_symbols(); fwriteint32_t(strslen + 4, ofile); /* length includes length count */ - saa_fpwrite(strs, ofile); + saa_fpwrite(coff_strs, ofile); } static void coff_section_header(char *name, int32_t namepos, int32_t vsize, @@ -1047,9 +1029,9 @@ static void coff_section_header(char *name, int32_t namepos, int32_t vsize, fwriteint32_t(flags, ofile); } -static void coff_write_relocs(struct Section *s) +static void coff_write_relocs(struct coff_Section *s) { - struct Reloc *r; + struct coff_Reloc *r; /* a real number of relocations if needed */ if (s->flags & IMAGE_SCN_LNK_NRELOC_OVFL) { @@ -1106,10 +1088,10 @@ static void coff_write_symbols(void) */ memset(filename, 0, 18); /* useful zeroed buffer */ - for (i = 0; i < (uint32_t) nsects; i++) { - coff_symbol(sects[i]->name, 0L, 0L, i + 1, 0, 3, 1); - fwriteint32_t(sects[i]->len, ofile); - fwriteint16_t(sects[i]->nrelocs,ofile); + for (i = 0; i < (uint32_t) coff_nsects; i++) { + coff_symbol(coff_sects[i]->name, 0L, 0L, i + 1, 0, 3, 1); + fwriteint32_t(coff_sects[i]->len, ofile); + fwriteint16_t(coff_sects[i]->nrelocs,ofile); nasm_write(filename, 12, ofile); } @@ -1121,9 +1103,9 @@ static void coff_write_symbols(void) /* * The real symbols. */ - saa_rewind(syms); - for (i = 0; i < nsyms; i++) { - struct Symbol *sym = saa_rstruct(syms); + saa_rewind(coff_syms); + for (i = 0; i < coff_nsyms; i++) { + struct coff_Symbol *sym = saa_rstruct(coff_syms); coff_symbol(sym->strpos == -1 ? sym->name : NULL, sym->strpos, sym->value, sym->section, sym->type, sym->is_global ? 2 : 3, 0); @@ -1132,13 +1114,13 @@ static void coff_write_symbols(void) static void coff_sectalign(int32_t seg, unsigned int value) { - struct Section *s = NULL; + struct coff_Section *s = NULL; uint32_t align; int i; - for (i = 0; i < nsects; i++) { - if (sects[i]->index == seg) { - s = sects[i]; + for (i = 0; i < coff_nsects; i++) { + if (coff_sects[i]->index == seg) { + s = coff_sects[i]; break; } } @@ -1165,12 +1147,14 @@ static void coff_std_filename(char *inname, char *outname) { strcpy(coff_infile, inname); standard_extension(inname, outname, ".o"); + strcpy(coff_outfile, outname); } static void coff_win32_filename(char *inname, char *outname) { strcpy(coff_infile, inname); standard_extension(inname, outname, ".obj"); + strcpy(coff_outfile, outname); } extern macros_t coff_stdmac[]; @@ -1206,14 +1190,18 @@ struct ofmt of_coff = { #endif +extern struct dfmt df_cv8; + #ifdef OF_WIN32 +struct dfmt *win32_debug_arr[2] = { &df_cv8, NULL }; + struct ofmt of_win32 = { "Microsoft Win32 (i386) object files", "win32", 0, - null_debug_arr, - &null_debug_form, + win32_debug_arr, + &df_cv8, coff_stdmac, coff_win32_init, coff_set_info, @@ -1231,12 +1219,14 @@ struct ofmt of_win32 = { #ifdef OF_WIN64 +struct dfmt *win64_debug_arr[2] = { &df_cv8, NULL }; + struct ofmt of_win64 = { "Microsoft Win64 (x86-64) object files", "win64", 0, - null_debug_arr, - &null_debug_form, + win64_debug_arr, + &df_cv8, coff_stdmac, coff_win64_init, coff_set_info, diff --git a/output/pecoff.h b/output/pecoff.h index 924ccd8..8b57d6b 100644 --- a/output/pecoff.h +++ b/output/pecoff.h @@ -474,4 +474,59 @@ #define IMPORT_NAME_NOPREFIX 2 #define IMPORT_NAME_UNDECORATE 3 +struct coff_Section { + struct SAA *data; + uint32_t len; + int nrelocs; + int32_t index; + struct coff_Reloc *head, **tail; + uint32_t flags; /* section flags */ + char *name; + int32_t namepos; /* Offset of name into the strings table */ + int32_t pos, relpos; +}; + +struct coff_Reloc { + struct coff_Reloc *next; + int32_t address; /* relative to _start_ of section */ + int32_t symbol; /* symbol number */ + enum { + SECT_SYMBOLS, + ABS_SYMBOL, + REAL_SYMBOLS + } symbase; /* relocation for symbol number :) */ + int16_t type; +}; + +struct coff_Symbol { + char name[9]; + int32_t strpos; /* string table position of name */ + int32_t value; /* address, or COMMON variable size */ + int section; /* section number where it's defined + * - in COFF codes, not NASM codes */ + bool is_global; /* is it a global symbol or not? */ + int16_t type; /* 0 - notype, 0x20 - function */ + int32_t namlen; /* full name length */ +}; + +struct coff_DebugInfo { + int32_t segto; + int32_t seg; + uint64_t size; + struct coff_Section *section; +}; + +extern struct coff_Section **coff_sects; +extern int coff_nsects; +extern struct SAA *coff_syms; +extern uint32_t coff_nsyms; +extern struct SAA *coff_strs; +extern bool win32, win64; + +extern char coff_infile[FILENAME_MAX]; +extern char coff_outfile[FILENAME_MAX]; + +extern int coff_make_section(char *name, uint32_t flags); + + #endif /* PECOFF_H */ -- 2.6.3 |
From: Jim K. <jam...@li...> - 2016-01-24 07:33:06
|
This implementation was written by Colin Plumb and is in the public domain. I've updated it to use stdint.h and the standard C types rather than sys/types.h for portability. Signed-off-by: Jim Kukunas <jam...@li...> --- Makefile.in | 3 +- Mkfiles/msvc.mak | 3 +- md5.h | 23 ++++++ md5c.c | 247 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 md5.h create mode 100644 md5c.c diff --git a/Makefile.in b/Makefile.in index ed5f89e..9894d33 100644 --- a/Makefile.in +++ b/Makefile.in @@ -91,7 +91,8 @@ NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \ lib/strlcpy.$(O) \ preproc-nop.$(O) \ disp8.$(O) \ - iflag.$(O) + iflag.$(O) \ + md5c.$(O) NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \ insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O) \ diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index b743412..a4df3e3 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -61,7 +61,8 @@ NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \ lib/strlcpy.$(O) \ preproc-nop.$(O) \ disp8.$(O) \ - iflag.$(O) + iflag.$(O) \ + md5c.$(O) NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \ insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O) \ diff --git a/md5.h b/md5.h new file mode 100644 index 0000000..147d3dd --- /dev/null +++ b/md5.h @@ -0,0 +1,23 @@ +#ifndef _MD5_H_ +#define _MD5_H_ + +#include <stdint.h> + +#define MD5_HASHBYTES 16 + +typedef struct MD5Context { + uint32_t buf[4]; + uint32_t bits[2]; + unsigned char in[64]; +} MD5_CTX; + +extern void MD5Init(MD5_CTX *context); +extern void MD5Update(MD5_CTX *context, unsigned char const *buf, + unsigned len); +extern void MD5Final(unsigned char digest[MD5_HASHBYTES], MD5_CTX *context); +extern void MD5Transform(uint32_t buf[4], uint32_t const in[16]); +extern char * MD5End(MD5_CTX *, char *); +extern char * MD5File(const char *, char *); +extern char * MD5Data (const unsigned char *, unsigned int, char *); + +#endif /* !_MD5_H_ */ diff --git a/md5c.c b/md5c.c new file mode 100644 index 0000000..2716232 --- /dev/null +++ b/md5c.c @@ -0,0 +1,247 @@ +/* + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * To compute the message digest of a chunk of bytes, declare an + * MD5Context structure, pass it to MD5Init, call MD5Update as + * needed on buffers full of bytes, and then call MD5Final, which + * will fill a supplied 16-byte array with the digest. + */ + +#include <string.h> /* for memcpy() */ +#include "md5.h" + +#if __BYTE_ORDER == 1234 +#define byteReverse(buf, len) /* Nothing */ +#else +void byteReverse(unsigned char *buf, unsigned longs); + +/* + * Note: this code is harmless on little-endian machines. + */ +void byteReverse(unsigned char *buf, unsigned longs) +{ + uint32_t t; + do { + t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 | + ((unsigned) buf[1] << 8 | buf[0]); + *(uint32_t *) buf = t; + buf += 4; + } while (--longs); +} +#endif + +/* + * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious + * initialization constants. + */ +void MD5Init(MD5_CTX *ctx) +{ + ctx->buf[0] = 0x67452301; + ctx->buf[1] = 0xefcdab89; + ctx->buf[2] = 0x98badcfe; + ctx->buf[3] = 0x10325476; + + ctx->bits[0] = 0; + ctx->bits[1] = 0; +} + +/* + * Update context to reflect the concatenation of another buffer full + * of bytes. + */ +void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len) +{ + uint32_t t; + + /* Update bitcount */ + + t = ctx->bits[0]; + if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) + ctx->bits[1]++; /* Carry from low to high */ + ctx->bits[1] += len >> 29; + + t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ + + /* Handle any leading odd-sized chunks */ + + if (t) { + unsigned char *p = (unsigned char *) ctx->in + t; + + t = 64 - t; + if (len < t) { + memcpy(p, buf, len); + return; + } + memcpy(p, buf, t); + byteReverse(ctx->in, 16); + MD5Transform(ctx->buf, (uint32_t *) ctx->in); + buf += t; + len -= t; + } + /* Process data in 64-byte chunks */ + + while (len >= 64) { + memcpy(ctx->in, buf, 64); + byteReverse(ctx->in, 16); + MD5Transform(ctx->buf, (uint32_t *) ctx->in); + buf += 64; + len -= 64; + } + + /* Handle any remaining bytes of data. */ + + memcpy(ctx->in, buf, len); +} + +/* + * Final wrapup - pad to 64-byte boundary with the bit pattern + * 1 0* (64-bit count of bits processed, MSB-first) + */ +void MD5Final(unsigned char digest[16], MD5_CTX *ctx) +{ + unsigned count; + unsigned char *p; + + /* Compute number of bytes mod 64 */ + count = (ctx->bits[0] >> 3) & 0x3F; + + /* Set the first char of padding to 0x80. This is safe since there is + always at least one byte free */ + p = ctx->in + count; + *p++ = 0x80; + + /* Bytes of padding needed to make 64 bytes */ + count = 64 - 1 - count; + + /* Pad out to 56 mod 64 */ + if (count < 8) { + /* Two lots of padding: Pad the first block to 64 bytes */ + memset(p, 0, count); + byteReverse(ctx->in, 16); + MD5Transform(ctx->buf, (uint32_t *) ctx->in); + + /* Now fill the next block with 56 bytes */ + memset(ctx->in, 0, 56); + } else { + /* Pad block to 56 bytes */ + memset(p, 0, count - 8); + } + byteReverse(ctx->in, 14); + + /* Append length in bits and transform */ + ((uint32_t *) ctx->in)[14] = ctx->bits[0]; + ((uint32_t *) ctx->in)[15] = ctx->bits[1]; + + MD5Transform(ctx->buf, (uint32_t *) ctx->in); + byteReverse((unsigned char *) ctx->buf, 4); + memcpy(digest, ctx->buf, 16); + memset((char *) ctx, 0, sizeof(ctx)); /* In case it's sensitive */ +} + +/* The four core functions - F1 is optimized somewhat */ + +/* #define F1(x, y, z) (x & y | ~x & z) */ +#define F1(x, y, z) (z ^ (x & (y ^ z))) +#define F2(x, y, z) F1(z, x, y) +#define F3(x, y, z) (x ^ y ^ z) +#define F4(x, y, z) (y ^ (x | ~z)) + +/* This is the central step in the MD5 algorithm. */ +#define MD5STEP(f, w, x, y, z, data, s) \ + ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) + +/* + * The core of the MD5 algorithm, this alters an existing MD5 hash to + * reflect the addition of 16 longwords of new data. MD5Update blocks + * the data and converts bytes into longwords for this routine. + */ +void MD5Transform(uint32_t buf[4], uint32_t const in[16]) +{ + register uint32_t a, b, c, d; + + a = buf[0]; + b = buf[1]; + c = buf[2]; + d = buf[3]; + + MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); + MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); + MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); + MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); + MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); + MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); + MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); + MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); + MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); + MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); + MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); + MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); + MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); + MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); + MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); + MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); + + MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); + MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); + MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); + MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); + MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); + MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); + MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); + MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); + MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); + MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); + MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); + MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); + MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); + MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); + MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); + MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); + + MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); + MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); + MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); + MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); + MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); + MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); + MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); + MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); + MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); + MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); + MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); + MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); + MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); + MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); + MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); + MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); + + MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); + MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); + MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); + MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); + MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); + MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); + MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); + MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); + MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); + MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); + MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); + MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); + MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); + MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); + MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); + MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; +} -- 2.6.3 |
From: Jim K. <jam...@li...> - 2016-01-24 07:33:04
|
Converts a relative pathname to an absolute pathname. Signed-off-by: Jim Kukunas <jam...@li...> --- nasmlib.c | 12 ++++++++++++ nasmlib.h | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/nasmlib.c b/nasmlib.c index ecd6d8d..9d57adb 100644 --- a/nasmlib.c +++ b/nasmlib.c @@ -696,6 +696,18 @@ char *nasm_opt_val(char *p, char **val, char **next) return p; } +#ifdef _WIN32 +char *nasm_realpath(const char *rel_path) +{ + return _fullpath(NULL, rel_path, 0); +} +#else +char *nasm_realpath(const char *rel_path) +{ + return realpath(rel_path, NULL); +} +#endif + /* * initialized data bytes length from opcode */ diff --git a/nasmlib.h b/nasmlib.h index a3a8c12..9cd417f 100644 --- a/nasmlib.h +++ b/nasmlib.h @@ -400,6 +400,13 @@ char *nasm_trim_spaces(char *p); char *nasm_get_word(char *p, char **tail); char *nasm_opt_val(char *p, char **opt, char **val); +/* + * Converts a relative pathname rel_path into an absolute path name. + * + * The buffer returned must be freed by the caller + */ +char *nasm_realpath(const char *rel_path); + const char *prefix_name(int); #define ZERO_BUF_SIZE 4096 -- 2.6.3 |
From: Jim K. <jam...@li...> - 2016-01-24 07:33:04
|
Hi Folks, This patchset adds support for the Codeview 8 debug format for PE/COFF files. The first two patches in this set lay the groundwork for the third. The first patch adds a utility function for converting a relative path to an absolute path, because Codeview wants absolute paths. Codeview stores an MD5 hash of the source file, so the second patch adds an implementation that's in the public domain. All of the interesting bits in the third patch are in codeview.c. Prior to this patch, COFF hadn't supported a debug format, so the debugs hooks weren't hooked up, nor were the necessary bits exposed external to outcoff.c. As a result, there's an ugly part of the diff for outcoff.c/pecoff.h that hooks up the debug calls, exports some definitions and variables, and renames the exported stuff to avoid collisions, e. g., Symbol -> coff_Symbol. I can roll the ugly part into its own patch if it really bothers people. So far, I've tested this in WinDbg for both 32- and 64-bit code. For more information on the Codeview 8 format, see https://github.com/yasm/yasm/blob/master/modules/dbgfmts/codeview/cv8.txt Let me know what you think. Thanks. -- Jim Kukunas Intel Open Source Technology Center |