Section attribute "K"?

  • Thread starter Thread starter Vincent Fatica
  • Start date Start date
V

Vincent Fatica

The docs say:

K Cacheable Marks the section as not cacheable

and

specify /SECTION:.text,!K and DUMPBIN will reveal section
characteristics, including "Not Cached."

There seems to be a contradiction. Does "K" mark the section as cacheable
or not cacheable?
 
Vincent Fatica said:
The docs say:

K Cacheable Marks the section as not cacheable

and

specify /SECTION:.text,!K and DUMPBIN will reveal section
characteristics, including "Not Cached."

There seems to be a contradiction. Does "K" mark the section as cacheable
or not cacheable?

I think the '!' negates the attribute. So K would be Cacheable and !K would
be NOT Cacheable.
 
I think the '!' negates the attribute. So K would be Cacheable and !K would
be NOT Cacheable.

That's what seems to be the case. So the table in the docs indicating:

K ... Cacheable ... Marks the section as not cacheable

is wrong, eh?
 
Vincent Fatica said:
That's what seems to be the case. So the table in the docs indicating:

K ... Cacheable ... Marks the section as not cacheable

is wrong, eh?

Oh, I'm a bonehead -- I see what you're saying now. :) Whatever its trying
to mean, that 'not' has been part of the documentation since at least Oct
2001. I think they try to make it make sense with the...

"K [is] peculiar in that the section flag... that correspond to [it] [is] in
the negative sense. If you specify [K] on the .text section
(/SECTION:.text,K), there will be no difference ... when you run DUMPBIN
[because] it was already implicitly cached. To remove [it] specify ...
!K..."

....but it still sounds like an explanation of a snake swallowing its tail.
 
Oh, I'm a bonehead -- I see what you're saying now. :) Whatever its trying
to mean, that 'not' has been part of the documentation since at least Oct
2001.

It's what you currently see online at MSDN:

MSDN Library > Development Tools and Languages > Visual Studio > Visual C++
Building a C/C++ Program > C/C++ Building Reference > Linking > Linker
Options > /SECTION (Specify Section Attributes)
 
Vincent Fatica said:
It's what you currently see online at MSDN:

I know. What I mean is it has said the same thing for ~5 years. While its
not impossible that its a typo or a mistake that's gone unnoticed for
half-a-decade and several linker versions, I suspect it is trying to say
something subtle with intent. The fact that all that gobbledygook about K
being peculiar has been added since then and now, indicates to me that
somebody has already said 'Huh?', and that the doc owner approved the 'not'
and then tried to make its intended meaning more clear. I'm not sure s/he
succeeded, because it still sounds backwards to me too. Of course, I'm only
a fry-cook and a self-confessed bonehead. :)
 
Since caching is an esoteric kernel mode thing, maybe the K attribute actually
is not handled by the loader, or handled in some not straightforward way.
Can the OP tell why he needs noncached memory (outside of kernel & device drivers context)?

Regards,
--PA
 
Back
Top