This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch]: Support coff noread flag for segments


2009/5/17 Dave Korn <dave.korn.cygwin@googlemail.com>:
> Kai Tietz wrote:
>
>>
>> Sorry, I copied it from console output and therefore things got
>> corrupt. Patch is appended to this mail as attachment.
>
> ?The patch itself is fine now, but I spotted something missing. ?You need to
> update the documentation of the ".section" pseudo-op in as.texinfo to explain
> the new letter. ?Ok once you've added documentation.
>
> ?Also, please give serious consideration to adding even just a single trivial
> testcase that would verify the new functionality continues to work and check
> with "objdump -h" that it sets the correct flags in the header. ?I can help
> with that if you're not familiar with the testsuite infrastructure.
>
> ? ?cheers,
> ? ? ?DaveK
>
>

So here is the patch with documentation changes, too. Possibly your
testcase for .drectve we could use here in gas, too?

Cheers,
Kai


-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
Index: src/gas/config/obj-coff.c
===================================================================
--- src.orig/gas/config/obj-coff.c
+++ src/gas/config/obj-coff.c
@@ -1475,6 +1475,7 @@ coff_frob_file_after_relocs (void)
                                                  'x' for text
   						 'r' for read-only data
   						 's' for shared data (PE)
+						 'y' for noread
    But if the argument is not a quoted string, treat it as a
    subsegment number.
 
@@ -1584,6 +1585,10 @@ obj_coff_section (int ignore ATTRIBUTE_U
 		    flags |= SEC_READONLY;
 		  break;
 
+		case 'y':
+		  flags |= SEC_COFF_NOREAD | SEC_READONLY;
+		  break;
+
 		case 'i': /* STYP_INFO */
 		case 'l': /* STYP_LIB */
 		case 'o': /* STYP_OVER */
@@ -1628,7 +1633,8 @@ obj_coff_section (int ignore ATTRIBUTE_U
       /* 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);
     }
Index: src/gas/doc/as.texinfo
===================================================================
--- src.orig/gas/doc/as.texinfo
+++ src/gas/doc/as.texinfo
@@ -5726,6 +5726,8 @@ executable section
 shared section (meaningful for PE targets)
 @item a
 ignored.  (For compatibility with the ELF version)
+@item y
+section is not readable (meaningful for PE targets)
 @end table
 
 If no flags are specified, the default flags depend upon the section name.  If

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]