This is the mail archive of the binutils@sources.redhat.com 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: [RFA] Coff SEC_LOAD vs SEC_NEVER_LOAD


"Svein E. Seldal" <Svein.Seldal@solidas.com> writes:

> Looking in coffcode.h i find this in styp_to_sec_flags():
> 
>     #ifdef STYP_NOLOAD
>       if (styp_flags & STYP_NOLOAD)
>         sec_flags |= SEC_NEVER_LOAD;
>     #endif /* STYP_NOLOAD */
> 
> followed by this:
> 
>     else
>       sec_flags |= SEC_ALLOC | SEC_LOAD;
> 
> Which confirms this obeservation. However, looking at the code, it
> surely seems like this code isnt made this way by accident.

I suspect that it is indeed an accident.  That function has grown
entirely by accretion.

Your proposed patch will break things, as there is code in the
function which explicitly checks for the SEC_NEVER_LOAD flag your
patch no longer sets.

I suspect that last line should just become something like
    else if (sec_flags & SEC_NEVER_LOAD)
      sec_flags |= SEC_ALLOC;
    else
      sec_flags |= SEC_ALLOC | SEC_LOAD;

Ian


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