[PATCH] D30169: Print unknown section header flags has hex in assembly output

Christof Douma via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 05:29:58 PST 2017


Hi Rafael.

There are a few more beside the one that Simon mentioned. You can find them by cross referencing the SHF_* enum values in include/llvm/Support/ELF.h and the code from lib/MC/MCSectionELF.cpp that I moved to printSectionFlags() in this patch. The ones I’ve identified this way are listed below.

Are there any objections to this patch?

Regards,
Christof

## Genric flags (maybe handled at some other location, or set using some other syntax?)
  SHF_MERGE = 0x10,
  SHF_INFO_LINK = 0x40U,
  SHF_LINK_ORDER = 0x80U,
  SHF_OS_NONCONFORMING = 0x100U,
  SHF_COMPRESSED = 0x800U,

## Target specific flags
  SHF_MASKOS = 0x0ff00000, // not a flag, but a mask
  SHF_MASKPROC = 0xf0000000, // not a flag, but a mask

  SHF_X86_64_LARGE = 0x10000000,
  SHF_HEX_GPREL = 0x10000000,
  SHF_MIPS_NODUPES = 0x01000000,
  SHF_MIPS_NAMES = 0x02000000,
  SHF_MIPS_LOCAL = 0x04000000,
  SHF_MIPS_NOSTRIP = 0x08000000,
  SHF_MIPS_GPREL = 0x10000000,
  SHF_MIPS_MERGE = 0x20000000,
  SHF_MIPS_ADDR = 0x40000000,
  SHF_MIPS_STRING = 0x80000000,
  SHF_AMDGPU_HSA_GLOBAL = 0x00100000,
  SHF_AMDGPU_HSA_READONLY = 0x00200000,
  SHF_AMDGPU_HSA_CODE = 0x00400000,
  SHF_AMDGPU_HSA_AGENT = 0x00800000


On 23/02/2017, 17:59, "Rafael Avila de Espindola" <rafael.espindola at gmail.com> wrote:

    What are the flags that are missing textual representation btw?

    Christof Douma via Phabricator <reviews at reviews.llvm.org> writes:

    > christof added a comment.
    >
    > To clarify. This patch fixes some cases where:
    >
    >   clang -S file.c -o - | clang -c - -o file.o
    >
    > is not identical to:
    >
    >   clang -c file.c -o file.o
    >
    > because the assembly output 'forgets' some of the flags in the output assembly.
    >
    > This impacts some assembly test that cover the MIPS code generator. In general, code generators that have section header flags without any assembly syntax will now use the new hex notation.
    >
    >
    > https://reviews.llvm.org/D30169


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the llvm-commits mailing list