[patch]: Support coff noread flag for segments
Kai Tietz
ktietz70@googlemail.com
Sat May 16 18:12:00 GMT 2009
2009/5/16 Dave Korn <dave.korn.cygwin@googlemail.com>:
> Kai Tietz wrote:
>
>> To point 2 and 3: I'll move it up to the 'i','l', and 'o' case with
>> blank line. This makes sense.
>
> Thanks.
>
>> Hmm, well we should set the read-only flag here, not zero'ing it out.
>
> Ahh, that rings a bell from something back in our earlier discussion, when
> IIRC I found it surprising that we would set both READONLY and NOREAD flags at
> the same time.
>
>> It makes not much differences here as we set READONLY in bfd IIRC, but
>> it makes things more clear to read.
>
> We should definitely do the same here to be consistent with BFD, not do the
> wrong thing and wait for BFD to cancel it out. (cf. bfd_install_relocation argh!)
>
> BTW, thanks for doing this. My aligned commons patch will now be able to
> use the "y" flag in the case when it ends up creating the .drectve section!
>
> cheers,
> DaveK
>
>
So, here the adjusted patch. I tested it for cygwin and mingw. Ok for apply?
Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
diff -u -r1.94 obj-coff.c
--- config/obj-coff.c 4 Oct 2007 17:05:37 -0000 1.94
+++ config/obj-coff.c 16 May 2009 18:10:08 -0000
@@ -1470,6 +1470,7 @@
+-- section name 'l' for lib
'n' for noload
'o' for over
+ 'y' for noread
'w' for data
'd' (apparently m88k for data)
'x' for text
@@ -1584,6 +1585,10 @@
flags |= SEC_READONLY;
break;
+ case 'y':
+ flags |= SEC_COFF_NOREAD | SEC_READONLY;
+ break;
+
case 'i': /* STYP_INFO */
case 'l': /* STYP_LIB */
case 'l': /* STYP_LIB */
case 'o': /* STYP_OVER */
@@ -1628,7 +1633,8 @@
/* This section's attributes have already been set. Warn if the
attributes don't match. */
flagword matchflags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
- | SEC_DATA | SEC_COFF_SHARED | SEC_NEVER_LOAD);
+ | SEC_DATA | SEC_COFF_SHARED | SEC_NEVER_LOAD
+ | SEC_COFF_NOREAD);
if ((flags ^ oldflags) & matchflags)
as_warn (_("Ignoring changed section attributes for %s"), name);
More information about the Binutils
mailing list