[llvm] r230156 - COFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sections

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Feb 22 07:44:34 PST 2015


A token testcase with llvm-readobj would be nice.

On 21 February 2015 at 21:35, David Majnemer <david.majnemer at gmail.com> wrote:
> Author: majnemer
> Date: Sat Feb 21 20:35:27 2015
> New Revision: 230156
>
> URL: http://llvm.org/viewvc/llvm-project?rev=230156&view=rev
> Log:
> COFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sections
>
> The CodeView debug info section, .debug$S, also has this set.  MinGW
> sets this bit for their DWARF sections as well.
>
> Modified:
>     llvm/trunk/lib/MC/MCObjectFileInfo.cpp
>
> Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=230156&r1=230155&r2=230156&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
> +++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Sat Feb 21 20:35:27 2015
> @@ -620,126 +620,151 @@ void MCObjectFileInfo::InitCOFFMCObjectF
>    DwarfAbbrevSection =
>      Ctx->getCOFFSection(".debug_abbrev",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfInfoSection =
>      Ctx->getCOFFSection(".debug_info",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfLineSection =
>      Ctx->getCOFFSection(".debug_line",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfFrameSection =
>      Ctx->getCOFFSection(".debug_frame",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfPubNamesSection =
>      Ctx->getCOFFSection(".debug_pubnames",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfPubTypesSection =
>      Ctx->getCOFFSection(".debug_pubtypes",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfGnuPubNamesSection =
>      Ctx->getCOFFSection(".debug_gnu_pubnames",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfGnuPubTypesSection =
>      Ctx->getCOFFSection(".debug_gnu_pubtypes",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfStrSection =
>      Ctx->getCOFFSection(".debug_str",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfLocSection =
>      Ctx->getCOFFSection(".debug_loc",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfARangesSection =
>      Ctx->getCOFFSection(".debug_aranges",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfRangesSection =
>      Ctx->getCOFFSection(".debug_ranges",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfMacroInfoSection =
>      Ctx->getCOFFSection(".debug_macinfo",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfInfoDWOSection =
>      Ctx->getCOFFSection(".debug_info.dwo",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfTypesDWOSection =
>      Ctx->getCOFFSection(".debug_types.dwo",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfAbbrevDWOSection =
>      Ctx->getCOFFSection(".debug_abbrev.dwo",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfStrDWOSection =
>      Ctx->getCOFFSection(".debug_str.dwo",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfLineDWOSection =
>      Ctx->getCOFFSection(".debug_line.dwo",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfLocDWOSection =
>      Ctx->getCOFFSection(".debug_loc.dwo",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfStrOffDWOSection =
>      Ctx->getCOFFSection(".debug_str_offsets.dwo",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfAddrSection =
>      Ctx->getCOFFSection(".debug_addr",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfAccelNamesSection =
>      Ctx->getCOFFSection(".apple_names",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfAccelNamespaceSection =
>      Ctx->getCOFFSection(".apple_namespaces",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfAccelTypesSection =
>      Ctx->getCOFFSection(".apple_types",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>    DwarfAccelObjCSection =
>      Ctx->getCOFFSection(".apple_objc",
>                          COFF::IMAGE_SCN_MEM_DISCARDABLE |
> +                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
>                          COFF::IMAGE_SCN_MEM_READ,
>                          SectionKind::getMetadata());
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list