Possible Bug with "n" Flag of .section Directive

Nick Clifton nickc@redhat.com
Thu Feb 22 10:46:00 GMT 2001


Hi Mark,

> > Maybe this is the bug.  Maybe this ought to be changed to:
> > 
> >   if ((sec_flags & SEC_LOAD) == 0)
> >     styp_flags |= STYP_NOLOAD;
> 
> I think you right idea, but I think you're looking at the COFF_WITH_PE 
> version. The non-COFF_WITH_PE version is right above it.

Duh!  Yes you are right.  The code for the non-COFF_WITH_PE version is
rather messy, but my guess at an (*untested*) patch would be:

Cheers
        Nick

Index: bfd/coffcode.h
===================================================================
RCS file: /cvs/src//src/bfd/coffcode.h,v
retrieving revision 1.53
diff -p -r1.53 coffcode.h
*** coffcode.h	2001/01/13 19:42:22	1.53
--- coffcode.h	2001/02/22 18:42:52
*************** sec_to_styp_flags (sec_name, sec_flags)
*** 466,471 ****
--- 466,473 ----
  #ifdef STYP_NOLOAD
    if ((sec_flags & (SEC_NEVER_LOAD | SEC_COFF_SHARED_LIBRARY)) != 0)
      styp_flags |= STYP_NOLOAD;
+   if ((styp_flags == 0) && ((sec_flags & SEC_LOAD) == 0))
+     styp_flags |= STYP_NOLOAD;
  #endif
  
    return styp_flags;



More information about the Binutils mailing list