Date: Thu, 4 Dec 1997 17:25:13 -0800 (PST) Message-Id: <199712050125.RAA26265@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: djgpp-workers AT delorie DOT com, djgpp AT delorie DOT com From: Nate Eldredge Subject: Minor libc bug: brk() writes into text section Precedence: bulk I found a small bug in brk() (src/libc/crt0/crt0.S). The variable __what_size_app_thinks_it_is is placed in the text section, I presume by mistake. This is not an actual problem under normal conditions, but if one should want to write-protect the text section, this will be a problem. Patch follows at end of message. Btw, does anyone know what should happen when you touch mprotect()ed memory, assuming a DPMI server that supports it? In different circumstances, using CWSDPMI r3, I get SIGSEGV's, page faults from the DPMI server, or even an endless stream of SIGSEGV's! (I think this may be the exception handler touching the memory and triggering another exception, but that's just a guess.) *** src/libc/crt0/crt0.s~ Sun Oct 6 00:19:30 1996 --- src/libc/crt0/crt0.s Wed Dec 3 20:43:42 1997 *************** *** 342,349 **** --- 342,351 ---- /*------------------------------------------------------------------------ -----*/ /* .lcomm __what_size_app_thinks_it_is, 4 */ + .data __what_size_app_thinks_it_is: .long end + .text .lcomm __what_we_return_to_app_as_old_size, 4 .lcomm __what_size_dpmi_thinks_we_are, 4 Nate Eldredge eldredge AT ap DOT net