From: sos AT buggy DOT prospect DOT com DOT ru (Sergey Okhapkin) Subject: ld bug 17 May 1998 12:43:19 -0700 Message-ID: <01BD81EB.237E9D80.cygnus.cygwin32.developers@sos> To: "'cygwin32-developers AT cygnus DOT com'" Cc: "'ian AT cygnus DOT com'" If input objects contains a section not defined in a linker's script, ld produces "invalid Windows NT image" because this section is not aligned on a page boundary. Try to compile: int __attribute__((section("mysection"))) i; main(){} Look at VMA of "mysection" section: section.exe: file format pei-i386 Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000200 00401000 00000198 00000400 2**2 CONTENTS, ALLOC, LOAD, CODE 1 .data 00000200 00402000 00000010 00000600 2**2 CONTENTS, ALLOC, LOAD, DATA 2 .bss 000000b8 00403000 00000000 00000000 2**2 ALLOC 3 .idata 00000200 00404000 00000154 00000800 2**2 CONTENTS, ALLOC, LOAD, DATA 4 .stab 00000400 00405000 000003c0 00000a00 2**2 CONTENTS, DEBUGGING, NEVER_LOAD 5 .stabstr 00000e00 00406000 00000c06 00000e00 2**0 CONTENTS, DEBUGGING, NEVER_LOAD 6 mysection 00000200 00406c08 00000004 00001c08 2**2 CONTENTS, ALLOC, LOAD, CODE -- Sergey Okhapkin, http://www.lexa.ru/sos Moscow, Russia