www.delorie.com/archives/browse.cgi | search |
> >> >> If you run gcc with '--save-temps' flag, and then look into > >> >> 'yourfile.s' file, you'll see that uninitialized data is tagged as > >> >> "common" (using '.comm' directive) and is put to bss only by linker > >> >> when final executable is created. To turn this feature off, use > >> >> '-fno-common' flag when compiling your object file. I just noticed that this doesn't help at all. When analyzing the object file with IDA you'll see that the BSS section has length 0. Thus, when you link several object files together, all variables are at the same memory position. I think it's a problem with the Assembler that doesn't generate valid COFF files. BTW, when compiling the same program under Linux the BSS section is not 0. So, it seems that the problem is Cygwin (COFF) specific. So far, the only way to reserve memory for a variable is to make it 0-initialized. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |