This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: coff section flags: STYP_COPY, in particular, for TI COFF files
John E Hein <jhein at timing dot com> writes:
> > Can you describe in more detail what is supposed to happen with a
> > STYP_COPY section? What would be an example use of such a section?
>
> According to TI support...
>
> "the documentation for copy section says these section will get loaded
> but not allocated in the memory"
>
> Again, remember their doc says:
> 'The term "loaded" means that the raw data for this section appears in
> the object file.'
>
> BTW, the BFD section flags for the STYP_COPY | STYP_DATA section are
> 0x243 (CONTENTS, ALLOC, LOAD, DATA).
>
> But just plain STYP_DATA sections (like .const) also get 0x243.
Well, given their definition of ``loaded,'' it sounds to me like an
STYP_COPY section is one which has contents, but the contents are not
copied into memory at execution time. This is true, for example, of a
section which holds debugging information. In BFD terms, I think such
a section would be SEC_HAS_CONTENTS, but no other flags (except maybe
SEC_RELOC).
The only way to know whether this makes any sense is to examine the
actual behaviour of the TI tools when given a STYP_COPY section. For
example: how is an STYP_COPY section created in the first place? What
happens to an STYP_COPY section at link time? At run time?
> > Ignore the comments in coff/internal.h. They may be accurate, or they
> > may not, and in any case the version of STYP_COPY they describe may
> > not be the one expected by the TI tools.
>
> Okay, so what are the correct docs to look at? Any coff gurus care to
> chime in (this is supposedly coff "version 2", btw)? I've seen
> snippets in various google searches that seem to have the same text as
> the comments in binutils internal.h; many search hits say very little
> about section types beyond text, data & bss.
One of the reasons why people should avoid COFF is that it was never
properly documented. The AT&T docs said nothing useful. There was an
O'Reilly book a while back, now out of print, which is more or less
``everything you wanted to know about COFF except what you really need
to know.''
I checked the O'Reilly book, and it does not mention STYP_COPY. My
SVR3 docs are sufficiently buried that I don't really feel like
searching for them. I would be surprised if they mention STYP_COPY.
Ian
- References:
- coff section flags: STYP_COPY, in particular, for TI COFF files
- Re: coff section flags: STYP_COPY, in particular, for TI COFF files
- Re: coff section flags: STYP_COPY, in particular, for TI COFF files
- Re: coff section flags: STYP_COPY, in particular, for TI COFF files
- Re: coff section flags: STYP_COPY, in particular, for TI COFF files