This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Possible Bug with "n" Flag of .section Directive
- To: "Mark E." <snowball3 at bigfoot dot com>
- Subject: Re: Possible Bug with "n" Flag of .section Directive
- From: Nick Clifton <nickc at redhat dot com>
- Date: 22 Feb 2001 10:46:23 -0800
- Cc: binutils at sources dot redhat dot com
- References: <3A93F3B3.25107.BDFCB@localhost>
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;