Skip to content
  • Ben Gamari's avatar
    3cac14d2
    nativeGen: Explicitly set flags of text sections on Windows · 3cac14d2
    Ben Gamari authored
    The binutils documentation (for COFF) claims,
    
    > If no flags are specified, the default flags depend upon the section
    > name. If the section name is not recognized, the default will be for the
    > section to be loaded and writable.
    
    We previously assumed that this would do the right thing for split
    sections (e.g. a section named `.text$foo` would be correctly inferred
    to be a text section). However, we have observed that this is not the
    case (at least under the clang toolchain used on Windows): when
    split-sections is enabled, text sections are treated by the assembler as
    data (matching the "default" behavior specified by the documentation).
    
    Avoid this by setting section flags explicitly. This should fix split
    sections on Windows.
    
    Fixes #22834.
    
    (cherry picked from commit 3ece9856)
    3cac14d2
    nativeGen: Explicitly set flags of text sections on Windows
    Ben Gamari authored
    The binutils documentation (for COFF) claims,
    
    > If no flags are specified, the default flags depend upon the section
    > name. If the section name is not recognized, the default will be for the
    > section to be loaded and writable.
    
    We previously assumed that this would do the right thing for split
    sections (e.g. a section named `.text$foo` would be correctly inferred
    to be a text section). However, we have observed that this is not the
    case (at least under the clang toolchain used on Windows): when
    split-sections is enabled, text sections are treated by the assembler as
    data (matching the "default" behavior specified by the documentation).
    
    Avoid this by setting section flags explicitly. This should fix split
    sections on Windows.
    
    Fixes #22834.
    
    (cherry picked from commit 3ece9856)
Loading Validating GitLab CI configuration… Learn more
Loading