From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: khan@xraylith.wisc.EDU Cc: ts1@cma.co.jp, binutils@sourceware.cygnus.com Subject: Re: patch for i386-pe section header [Re: section bug?] Date: Thu, 01 Jul 1999 00:00:00 -0000 Message-id: <19990627012422.14497.qmail@daffy.airs.com> References: <199906262331.SAA01315@mercury.xraylith.wisc.edu> <199906262331.SAA01315@mercury.xraylith.wisc.edu> X-SW-Source: 1999-q2/msg00365.html Date: Sat, 26 Jun 1999 18:31:14 -0500 From: Mumit Khan The following should fix this bug. Sat Jun 26 18:25:30 1999 Mumit Khan * peicode.h (coff_swap_scnhdr_out): Mark user-defined writable sections as writable. Index: bfd/peicode.h =================================================================== RCS file: /cvs/binutils/binutils/bfd/peicode.h,v retrieving revision 1.3 diff -u -3 -p -r1.3 peicode.h --- bfd/peicode.h 1999/05/25 11:37:40 1.3 +++ bfd/peicode.h 1999/06/26 23:22:14 @@ -1234,6 +1234,8 @@ coff_swap_scnhdr_out (abfd, in, out) | IMAGE_SCN_MEM_SHARED | IMAGE_SCN_MEM_READ); else if (strcmp (scnhdr_int->s_name, ".rsrc") == 0) flags |= IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_SHARED; + else if (! (flags & SEC_READONLY)) + flags |= IMAGE_SCN_MEM_WRITE; else flags |= IMAGE_SCN_MEM_READ; In the second new line, shouldn't that be flags |= IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE ? I would almost just check that in, but I thought I'd better check to see if I was missing something. Ian