0

In GCC/MinGW when I map a function to a specific section can I expect the sections Characteristics bits 5, 9 and 30(IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ) to be set or always set? What about for an all variable mapped section?
I just wanted to know if I could confirm a section by checking the DWORD Characteristics along with the name. I could check with a hex-editor, but not sure if there was an official statement on it, in case the results were to suddenly differ with a new version of the compiler(or similar case).

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Salem
1

> to be set or always set?
Not at all.
The compiler just outputs the code such that it's tagged with the right section name.

It's the linker and linker configuration script which set the properties of each section of memory.

As for checking say that a particular code section has the 'x' bit set say, before calling it, I've no idea.

Votes + Comments
Well, thanks.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.