From 0863eca1d3dce529cc737a6b09b3168c215eca76 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 15 Sep 2016 15:11:49 +0000 Subject: [PATCH] Document our extension to the COFF .section directive flags git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281616 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/Extensions.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/Extensions.rst b/docs/Extensions.rst index f7029215c19..6c50abf192f 100644 --- a/docs/Extensions.rst +++ b/docs/Extensions.rst @@ -165,6 +165,22 @@ and ``.bar`` is associated to ``.foo``. .section .foo,"bw",discard, "sym" .section .bar,"rd",associative, "sym" +MC supports these flags in the COFF ``.section`` directive: + + - ``b``: BSS section (``IMAGE_SCN_CNT_INITIALIZED_DATA``) + - ``d``: Data section (``IMAGE_SCN_CNT_UNINITIALIZED_DATA``) + - ``n``: Section is not loaded (``IMAGE_SCN_LNK_REMOVE``) + - ``r``: Read-only + - ``s``: Shared section + - ``w``: Writable + - ``x``: Executable section + - ``y``: Not readable + - ``D``: Discardable (``IMAGE_SCN_MEM_DISCARDABLE``) + +These flags are all compatible with gas, with the exception of the ``D`` flag, +which gnu as does not support. For gas compatibility, sections with a name +starting with ".debug" are implicitly discardable. + ELF-Dependent ------------- -- 2.50.1